Skip to content

[Feature] support outputs transmit to follow steps #2157

Open
@nkuacac

Description

Problem Statement

steps:
    - try:
      - description: ""
        script:
          ...
          outputs:
            - name: result
              value: (json_parse($stdout).status.result)
    - try:
       - description: "use outputs_result to get before step result"
          apply:
            bindings:
               - name: get_from_before_step
                  value: ($outputs_result)

Solution Description

type StepProcessor interface {
	Run(context.Context, namespacer.Namespacer, engine.Context, engine.Context) **engine.Context**
}
func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespacer, tc engine.Context, testTc engine.Context) engine.Context {
...
			for k, v := range outputs {
				tc = tc.WithBinding(ctx, k, v)
				**testTc = testTc.WithBinding(ctx, "outputs_"+k, v)**
			}
		}
	}
	return testTc
}

Alternatives

No response

Additional Context

No response

Slack discussion

No response

Research

  • I have searched other issues in this repository and mine is not recorded.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      [Feature] support outputs transmit to follow steps · Issue #2157 · kyverno/chainsaw