Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple interpolations in stepResult substitution should be allowed #7764

Closed
ericzzzzzzz opened this issue Mar 18, 2024 · 1 comment · Fixed by #7830
Closed

multiple interpolations in stepResult substitution should be allowed #7764

ericzzzzzzz opened this issue Mar 18, 2024 · 1 comment · Fixed by #7830
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@ericzzzzzzz
Copy link
Contributor

ericzzzzzzz commented Mar 18, 2024

Expected Behavior

  • multiple interpolations in stepResult substitution should be allowed in Env, command, args in a step, take environment variable substitutions as an example, key1=$(step.<step-name>.results.result1)-$(steps.<step-name>.results.result2), should be resolved to key1=value1-value2

Actual Behavior

  • current it throws an error
    {"level":"error","ts":1710775011.3269901,"caller":"entrypoint/entrypointer.go:206","msg":"Error while substituting step results: must be one of the form 1). \"tasks.<taskName>.results.<resultName>\"; 2). \"tasks.<taskName>.results.<objectResultName>.<individualAttribute>\"; 3). \"steps.<stepName>.results.<resultName>\"; 4). \"steps.<stepName>.results.<objectResultName>.<individualAttribute>\"","stacktrace":"github.com/tektoncd/pipeline/pkg/entrypoint.Entrypointer.Go\n\tgithub.com/tektoncd/pipeline/pkg/entrypoint/entrypointer.go:206\nmain.main\n\tgithub.com/tektoncd/pipeline/cmd/entrypoint/main.go:178\nruntime.main\n\truntime/proc.go:267"}

Steps to Reproduce the Problem

  1. return on enable-step-actions feature flag
  2. create this taskRun
   apiVersion: tekton.dev/v1alpha1
kind: StepAction
metadata:
  name: step-action
spec:
  image: alpine
  results:
    - name: result1
    - name: result2
  script: |
    echo "I am a Step Action!!!" >> $(step.results.result1.path)
    echo "I am a hidden step action!!!" >> $(step.results.result2.path)
---
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: step-action-run
spec:
  TaskSpec:
    results:
      - name: step-result
        value: $(steps.action-runner.results.result1)
    steps:
      - name: action-runner
        ref:
          name: step-action
      - name: test-multiple-interpolations
        image: busybox
        command:
          - "echo"
          - "$(steps.action-runner.results.result1)-$(steps.action-runner.results.result2)"

**Tekton pipeline Version **
v0.57

@ericzzzzzzz ericzzzzzzz added the kind/bug Categorizes issue or PR as related to a bug. label Mar 18, 2024
@ericzzzzzzz
Copy link
Contributor Author

/assign ericzzzzzzz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant