-
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
Finally tasks not triggered in case of task failing due to missing results #7330
Comments
Thanks! I will take a look |
/assign |
I think this is caused by this pr #6792 |
using tekton v0.54.0. Same issue. In my case failed task had no image digest pushed in the result, because the build failed. Pipelinerun finished on the build-buildpack task.
output of the build-buildpack task:
the final task is not executed finally:
# ┌─────────────────────────────────────────────────────────────────────
# │ ⚫ Final Notify
# └─────────────────────────────────────────────────────────────────────
- name: notify
displayName: "Notification from $(context.pipeline.name)"
when:
- input: $(params.workflow.notify)
operator: in
values: ['true']
taskRef:
name: notify
workspaces:
- name: source
workspace: source
params:
- name: working_directory
value: $(params.git.checkout_directory)
- name: environment
value: $(params.environment)
- name: application
value:
project: $(params.application.project)
component: $(params.application.component)
url: $(params.application.url)
argocd_app: $(params.application.argocd_app)
argocd_url: $(params.application.argocd_url)
tekton_url: $(params.application.tekton_url)
jira_url: $(params.application.jira_url)
jira_prefix: $(params.application.jira_prefix)
grafana_url: $(params.application.grafana_url)
karma_url: $(params.application.karma_url)
alertmanager_url: $(params.application.alertmanager_url)
sentry_url: $(params.application.sentry_url)
documentation_url: $(params.application.documentation_url)
devops_team: $(params.application.devops_team)
pm_team: $(params.application.pm_team)
tm_team: $(params.application.tm_team)
lead_developers: $(params.application.lead_developers)
- name: git
value:
repository_url: $(params.git.repository_url)
checkout_branch: $(params.git.checkout_branch)
checkout_revision: $(params.git.checkout_revision)
commit_author: $(params.git.commit_author)
commit_author_url: $(params.git.commit_author_url)
commit_message: $(params.git.commit_message)
- name: status
value: $(tasks.status)
- name: pipelinerun
value:
name: $(context.pipelineRun.name)
namespace: $(context.pipelineRun.namespace)
uid: $(context.pipelineRun.uid)
- name: image_digest
value: $(tasks.build-$(params.build.use).results.app_image_digest) |
Thanks! Just come back from holidays, will work on this issue |
@Yongxuanzhang any updates? |
Sorry I'm kinda busy recently, 😢 , don't have enough time to come up with a solution yet. |
Is there any chance that anybody would work on this? |
@Yongxuanzhang If you are not working, shall I assign this issue to myself? |
@Yongxuanzhang is on leave for now so please go ahead @divyansh42. I don't think he will mind 😄 |
Does anybody plan to work on this? |
/assign |
I attempted to solve this bug but I think this is not actually a bug but more of design enhancement, therefore I would need others opinion as well. So, I am considering this as more of a design enhancement where we want to know what should be the status when taskrun is not created and the task fails at the runtime validation. @pritidesai @afrittoli @vdemeester please let me know your thoughts on this. Also, please suggest if you think any other approach is feasible. Thanks. |
How is this different from tasks that are skipped because of |
@ppitonak In the case of the |
@divyansh42 thanks for looking into this. Regarding your comment:
How Tekton is representing internally the inability to execute This definitely seems to me like a bug in Tekton, which we should address. The only documented case where a finally task is not executed, is when it depends directly on a result which was not produced. Changing that would require implementing TEP-0048. |
Thank you @afrittoli for taking a look at this. Initially, I had the same conclusion that task-b has been evaluated so DAG should be complete. By looking at the implementation it seems we can only mark this as failed when the corresponding Taskrun is created. In this case, taskrun is not getting created. |
There are two options to solve this that I see:
My preferred would be (1), although I have not checked the code to see what it would take to implement it. |
If we mark that |
Expected Behavior
I have a pipeline with two tasks - first one producing a result, second one using the result and finally task not using the result at all. Finally task should always run.
Actual Behavior
When first task doesn't produce the result, second one correctly fails. Finally task is skipped.
Steps to Reproduce the Problem
Additional Info
Kubernetes version:
Output of
kubectl version
:Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
Similar to #4438
The text was updated successfully, but these errors were encountered: