-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix variable interpolation on
StepTemplate
This changes the way we interpolate variables by using `StepTemplate` directly instead of modifying a de-referenced version of it. Dereferencing means that changes happening to it (in `ApplyStepReplacements`) are not reflected to the original object. Before this change, using variable interpolation on `StepTemplate` would only work on part of the fields they were supposed to be. For example, it works on `env` because, it is an array and the de-referenced version of `StepTemplate` would share the same pointer to it, making any changes on the array reflect to the initial object. This is now fixed. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
- Loading branch information
1 parent
7de70f1
commit 179f349
Showing
5 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
examples/v1beta1/taskruns/steptemplate-variable-interop.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: steptemplate-variables- | ||
spec: | ||
params: | ||
- name: image | ||
value: ubuntu | ||
taskSpec: | ||
params: | ||
- name: image | ||
stepTemplate: | ||
image: $(params.image) | ||
steps: | ||
- name: foo | ||
script: | | ||
echo hello from $(params.image) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters