-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design and implement Pipeline Results for pipeline with finally tasks #2710
Comments
/kind feature |
@pritidesai has created a WIP design at Task Results with finally |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-lifecycle rotten |
@vdemeester: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Reopening as this feature is not implemented yet. And will be a good feature to have finally task produce some kind of result and have it as part of the pipeline. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/lifecycle frozen may be useful even for pipelines in pipelines for the results from finally tasks to be passed to pipeline results |
Is the idea here that a Was curious to see what happens if a ExampleModified the # Pipeline to clone repo into shared workspace and cleanup the workspace after done
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: clone-cleanup-workspace
spec:
results:
- name: initialized
value: $(tasks.check-git-commit.results.init)
workspaces:
# common workspace where git repo is cloned and needs to be cleanup after done
- name: git-source
tasks:
# Clone app repo to workspace
- name: clone-app-repo
taskRef:
name: git-clone-from-catalog
params:
- name: url
value: https://github.com/tektoncd/community.git
- name: subdirectory
value: application
workspaces:
- name: output
workspace: git-source
finally:
# Cleanup workspace
- name: cleanup
taskRef:
name: cleanup-workspace
workspaces:
- name: source
workspace: git-source
- name: check-git-commit
params:
- name: commit
value: $(tasks.clone-app-repo.results.commit)
taskSpec:
params:
- name: commit
results:
- name: init
steps:
- name: check-commit-initialized
image: alpine
script: |
if [[ ! $(params.commit) ]]; then
exit 1
fi
printf true | tee /tekton/results/init And this was the created $ tkn pr describe -L
Name: write-and-cleanup-workspace
Namespace: default
Pipeline Ref: clone-cleanup-workspace
Service Account: default
Timeout: 1h0m0s
Labels:
tekton.dev/pipeline=clone-cleanup-workspace
🌡️ Status
STARTED DURATION STATUS
42 seconds ago 26 seconds Succeeded
📦 Resources
No resources
⚓ Params
No params
📝 Results
NAME VALUE
∙ initialized true
📂 Workspaces
NAME SUB PATH WORKSPACE BINDING
∙ git-source --- VolumeClaimTemplate
🗂 Taskruns
NAME TASK NAME STARTED DURATION STATUS
∙ write-and-cleanup-workspace-check-git-commit check-git-commit 24 seconds ago 7 seconds Succeeded
∙ write-and-cleanup-workspace-cleanup cleanup 24 seconds ago 8 seconds Succeeded
∙ write-and-cleanup-workspace-clone-app-repo clone-app-repo 42 seconds ago 18 seconds Succeeded
⏭️ Skipped Tasks
No Skipped Tasks |
/assign @vsinghai |
This feature has been proposed in TEP-0116: Referencing Finally Task Results in Pipeline Results. |
This was fixed by @vsinghai in https://github.com/tektoncd/community/blob/main/teps/0116-referencing-finally-task-results-in-pipeline-results.md - thank you! |
A new field
finally
is being introduced toPipelineSpec
at the same level asTasks
,Params
, andWorkspaces
. Thefinally
field is a list of one or morePipelineTasks
similar toTasks
that provide a guarantee that they are executed only once allPipelineTasks
under tasks have completed regardless if that is because of success or error.This new type is getting added with PR #2650 and functionality with PR #2661
While designing and implementing
finally
, task results were deferred to next iteration. Issue #2557 is tracking task results and in this issue, we will keep track of adding pipeline results to the pipeline withfinally
.The text was updated successfully, but these errors were encountered: