-
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
1 parent
a8c7721
commit 369665c
Showing
8 changed files
with
679 additions
and
31 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
77 changes: 77 additions & 0 deletions
77
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,77 @@ | ||
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: task-result | ||
description: "grabbing results from the tasks section" | ||
value: $(tasks.multiply-inputs.results.product) | ||
- name: finally-result | ||
description: "grabbing results from the finally section" | ||
value: $(finally.exponent.results.product) | ||
tasks: | ||
- name: multiply-inputs | ||
taskRef: | ||
name: multiply | ||
params: | ||
- name: a | ||
value: "$(params.a)" | ||
- name: b | ||
value: "$(params.b)" | ||
finally: | ||
- name: exponent | ||
taskRef: | ||
name: multiply | ||
params: | ||
- name: a | ||
value: "$(tasks.multiply-inputs.results.product)$(tasks.multiply-inputs.results.product)" | ||
- name: b | ||
value: "$(tasks.multiply-inputs.results.product)$(tasks.multiply-inputs.results.product)" | ||
--- | ||
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: "1" |
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
Oops, something went wrong.