-
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.
Add support for finally task results in pipeline results
Prior to this commit, finally tasks can emit Results but results emitted from the finally tasks can not be configured in the Pipeline Results. In this commit, we add implementation for supporting finally tasks in Pipeline results, update documentation to reflect these changes, and add examples for the users to better understand the new feature being added. References [TEP-0116](tektoncd/community#746) /kind feature /cc @jerop
- Loading branch information
Showing
7 changed files
with
218 additions
and
29 deletions.
There are no files selected for viewing
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
110 changes: 110 additions & 0 deletions
110
examples/v1beta1/pipelineruns/pipelinerun-with-final-results.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,110 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: sum-and-multiply-pipeline | ||
spec: | ||
params: | ||
- name: a | ||
type: string | ||
default: "1" | ||
- name: b | ||
type: string | ||
default: "1" | ||
results: | ||
- name: finally-result | ||
description: "grabbing results from the finally section" | ||
value: $(finally.sum-and-multiply.results.sum) | ||
|
||
tasks: | ||
- name: sum-inputs | ||
taskRef: | ||
name: sum | ||
params: | ||
- name: a | ||
value: "$(params.a)" | ||
- name: b | ||
value: "$(params.b)" | ||
- name: multiply-inputs | ||
taskRef: | ||
name: multiply | ||
params: | ||
- name: a | ||
value: "$(params.a)" | ||
- name: b | ||
value: "$(params.b)" | ||
finally: | ||
- name: sum-and-multiply | ||
taskRef: | ||
name: sum | ||
params: | ||
- name: a | ||
value: "$(tasks.multiply-inputs.results.product)$(tasks.sum-inputs.results.sum)" | ||
- name: b | ||
value: "$(tasks.multiply-inputs.results.product)$(tasks.sum-inputs.results.sum)" | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: sum | ||
annotations: | ||
description: | | ||
A simple task that sums the two provided integers | ||
spec: | ||
params: | ||
- name: a | ||
type: string | ||
default: "1" | ||
description: The first integer | ||
- name: b | ||
type: string | ||
default: "1" | ||
description: The second integer | ||
results: | ||
- name: sum | ||
description: The sum of the two provided integers | ||
steps: | ||
- name: sum | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
echo -n $(( "$(params.a)" + "$(params.b)" )) | tee $(results.sum.path) | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: multiply | ||
annotations: | ||
description: | | ||
A simple task that multiplies the two provided integers | ||
spec: | ||
params: | ||
- name: a | ||
type: string | ||
default: "1" | ||
description: The first integer | ||
- name: b | ||
type: string | ||
default: "1" | ||
description: The second integer | ||
results: | ||
- name: product | ||
description: The product of the two provided integers | ||
steps: | ||
- name: product | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
echo -n $(( "$(params.a)" * "$(params.b)" )) | tee $(results.product.path) | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: sum-and-multiply-pipeline-run- | ||
spec: | ||
pipelineRef: | ||
name: sum-and-multiply-pipeline | ||
params: | ||
- name: a | ||
value: "2" | ||
- name: b | ||
value: "10" |
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
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