Skip to content

Support implicit parameter propagation from Pipeline to Tasks #44

@vdemeester

Description

@vdemeester

Problem

Tekton supports implicit parameter propagation — when a Pipeline defines params, they are automatically available to embedded Tasks without explicit params mapping in each pipeline task. Currently chisel/mallet requires explicit params mapping for every task.

Tekton Spec

apiVersion: tekton.dev/v1
kind: PipelineRun
spec:
  params:
  - name: message
    value: "hello"
  pipelineSpec:
    params:
    - name: message
    tasks:
    - name: greet
      taskSpec:
        # No explicit params mapping needed!
        # $(params.message) is automatically available
        steps:
        - name: print
          image: alpine
          script: echo $(params.message)

Upstream examples

  • propagating_params_implicit_parameters.yaml
  • propagating_params_in_pipeline.yaml

Implementation

When resolving $(params.X) in a task that doesn't explicitly declare the param, fall back to the pipeline-level params. This should be done in the parameter substitution phase of the parser/orchestrator.

Acceptance Criteria

  • Pipeline params are available in tasks without explicit mapping
  • Explicit task-level params override pipeline-level params
  • PipelineRun-level param values propagate through
  • propagating_params_* upstream examples pass
  • Works with both chisel and mallet

Jira: SRVKP-11415 (sub-gap)
Parent tracking: #41

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions