Example
How It Works
1
PipelineRun Provides Parameters
The PipelineRun provides three parameters:
pl-param-x, pl-param-y, and pl-param-z. Note that pl-param-z is extra and not used by the pipeline.2
Pipeline Accepts Two Parameters
The Pipeline only declares two parameters (
pl-param-x and pl-param-y). The extra parameter is ignored without causing an error.3
Pipeline Passes Parameters to Task
The Pipeline maps its parameters to the task’s parameters using
$(params.pl-param-x) syntax. The pipeline parameter names don’t need to match the task parameter names.4
Task Executes with Parameters
The task receives the parameter values and performs the addition operation using bash arithmetic.
Parameter Mapping
Parameters flow through three levels:- PipelineRun:
pl-param-x→ Pipeline:pl-param-x→ Task:a - PipelineRun:
pl-param-y→ Pipeline:pl-param-y→ Task:b
Extra Parameters
Tekton allows PipelineRuns to provide extra parameters that aren’t used by the Pipeline. This can be useful for:- Forward compatibility when adding new parameters
- Reusing PipelineRun templates across different pipelines
- Conditional parameter usage (though not in this example)
Expected Output
Alternative Syntax
Note that the task uses$(inputs.params.a) which is equivalent to the shorter $(params.a) syntax. Both are supported for backward compatibility.
Key Concepts
- Parameter Flow: Parameters cascade from PipelineRun → Pipeline → Task
- Parameter Mapping: Each level can rename parameters when passing them down
- Extra Parameters: PipelineRuns can provide more parameters than the Pipeline declares
- Type Safety: Parameters have types (string, array, object) that are validated
Next Steps
- See pipeline results
- Learn about real-world git clone pipelines