Pipeline: context.pipelineRun.name value not substituted in final task

Created on 9 Jul 2020  Â·  5Comments  Â·  Source: tektoncd/pipeline

Expected Behavior

Adding

params:
        - name: pipelineRunName
          value: "$(context.pipelineRun.name)"

to a task under finally in a pipeline should pass the name of the pipeline run to that task.

Actual Behavior

Instead, the value passed to the task is $(context.pipelineRun.name)

Steps to Reproduce the Problem

  1. Create a pipeline with a finally block.
  2. Add a param to a task in the finally block which sets the value as $(context.pipelineRun.name)
  3. 3.

Additional Info

  • Kubernetes version:

    Output of kubectl version:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:18:29Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
  • Tekton Pipeline version:
$ kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
v0.14.0


I've confirmed this feature works for a task not inside a finally block. It looks like the combination of these two new features aren't working together.

kinbug

All 5 comments

@mike1451 I think it should be fixed by https://github.com/tektoncd/pipeline/pull/2908 — which will be in 0.14.1 :pray:

yup just validated, should be fixed with #2908

 finally:
    - name: echo-pipeline-run-name
      taskRef:
        name: echo-task
      params:
        - name: a
          value: "$(context.pipelineRun.name)"

@mike1451 let me know once you verify, I will close this issue.

/close

@vdemeester: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings