Skip to main content
This example demonstrates the parameter flow from PipelineRun through Pipeline to individual Tasks, including how to handle extra parameters.

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:
Each level can have different parameter names:
  • 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

The task adds 100 + 200 = 300.

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