Allow param and workspace propagation in Pipeline and Tasks
Feature request (or a Bug related to param and workspace propagation)
TEP0107 introduced parameter propagation between PipelineRuns --> Pipelines and TaskRuns --> Tasks.
However, it missed it in parameter and workspace propagation within a Pipeline (i.e. Pipeline --> PipelineTasks --> Steps). We should be able to propagate params and workspaces within the same document for a more consistent workflow and reduction in verbosity.
Use case
- Reduction in verbosity.
- Consistent UX.
Currently this (param propagation in a pipelinerun) works:
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: param-example
spec:
params:
- name: p1
value: p1
- name: p2
value: p2
- name: p3
value: p3
pipelineSpec:
tasks:
- name: t1
taskSpec:
steps:
- image: ubuntu
command: ["echo"]
args: ["$(params.p1)"]
- name: t2
taskSpec:
steps:
- image: ubuntu
command: ["echo"]
args: ["$(params.p2)"]
- name: t3
taskSpec:
steps:
- image: ubuntu
command: ["echo"]
args: ["$(params.p3)"]
But this (param propagation within a pipeline) does not work. My assumption was that it should work since the params are defined in the context of the Pipeline, just like they were in the context of the PipelineRun earlier:
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: param-example
spec:
params:
- name: p1
- name: p2
- name: p3
tasks:
- name: t1
taskSpec:
steps:
- image: ubuntu
command: ["echo"]
args: ["$(params.p1)"]
- name: t2
taskSpec:
steps:
- image: ubuntu
command: ["echo"]
args: ["$(params.p2)"]
- name: t3
taskSpec:
steps:
- image: ubuntu
command: ["echo"]
args: ["$(params.p3)"]
Currently, you need to declare the params in TaskSpecs and pass them through pipelineTasks.
I'm inclined to treat this as a bug rather than a new feature since it is inconsistent when switching between in-lined and referenced pipelines. The same also applies to Tasks and TaskRuns.
/kind bug
@tektoncd/core-collaborators WDYT?
Agreement from API WG on Monday 13th that this was an oversight and should be fixed!