Skip to content

Commit

Permalink
Propagated Parameters for Finally Tasks
Browse files Browse the repository at this point in the history
Propagated parameters was only called for regular pipeline tasks, not finally tasks.
This was due to an oversight, and not a design choice. This PR extends
the propagated paramsters usage to finally tasks now. It addresses
issue #5588 .
  • Loading branch information
chitrangpatel committed Oct 4, 2022
1 parent 5d34b0c commit 35615de
Show file tree
Hide file tree
Showing 5 changed files with 407 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ spec:
script: |
#!/usr/bin/env bash
echo "$(params.HELLO)"
finally:
- name: echo-hello-finally
taskSpec:
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "And Finally ... $(params.HELLO)"
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ spec:
script: |
#!/usr/bin/env bash
echo "$(params.HELLO)"
finally:
- name: echo-hello-finally
params:
- name: HELLO
value: "Finally Hello World!"
taskSpec:
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "And finally.. $(params.HELLO)"
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ spec:
script: |
#!/usr/bin/env bash
echo "$(params.HELLO)"
finally:
- name: echo-hello-finally
taskSpec:
params:
- name: HELLO
default: "Default Hello World!"
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "And finally... $(params.HELLO)"
1 change: 1 addition & 0 deletions pkg/reconciler/pipelinerun/resources/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ func ApplyReplacements(ctx context.Context, p *v1beta1.PipelineSpec, replacement
if p.Finally[i].TaskRef != nil && p.Finally[i].TaskRef.Params != nil {
p.Finally[i].TaskRef.Params = replaceParamValues(p.Finally[i].TaskRef.Params, replacements, arrayReplacements, objectReplacements)
}
p.Finally[i], replacements, arrayReplacements, objectReplacements = propagateParams(ctx, p.Finally[i], replacements, arrayReplacements, objectReplacements)
}

return p
Expand Down
Loading

0 comments on commit 35615de

Please sign in to comment.