Documentation
¶
Overview ¶
Package resolver performs Tekton-style variable substitution:
$(params.name) – scalar param $(params.obj.key) – object param key $(params.arr[*]) – array param expanded into multiple args (only via SubstituteArgs) $(tasks.X.results.Y) – named result from a previously-executed task $(context.taskRun.name) – synthesized context var
The double-dollar literal `$$` produces a single `$` and is not interpreted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Substitute ¶
Substitute replaces $(...) references in s using ctx. Returns an error for unknown references.
func SubstituteAllowStepRefs ¶ added in v1.2.0
SubstituteAllowStepRefs is like Substitute but leaves $(step.results.X.path) and $(steps.<step>.results.<name>) placeholders intact when the context hasn't populated StepResults / CurrentStep. Used by the engine's task-level pass; per-step substitution happens later in the docker backend.
func SubstituteArgs ¶
SubstituteArgs is like Substitute but operates on a []string and supports $(params.x[*]) — the entire arg is replaced by the array's elements.
Types ¶
type Context ¶
type Context struct {
Params map[string]string // string params
ArrayParams map[string][]string // array params (only used by SubstituteArgs for [*] expansion)
ObjectParams map[string]map[string]string // object params
Results map[string]map[string]string // task name → result name → value
ContextVars map[string]string // dotted name → value (without "context." prefix)
// StepResults are the results produced by earlier steps within the same
// Task. Populated by the docker backend right before each step launches;
// nil during the engine's task-level substitution pass.
StepResults map[string]map[string]string
// CurrentStep is the step being resolved; required to resolve
// $(step.results.<name>.path) to /tekton/steps/<step>/results/<name>.
CurrentStep string
}