-
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
Fix Task(Run)/Pipeline(Run) metadata propagation #4638
Fix Task(Run)/Pipeline(Run) metadata propagation #4638
Conversation
/hold |
The following is the coverage report on the affected files.
|
ddc0a26
to
02fd0de
Compare
The following is the coverage report on the affected files.
|
02fd0de
to
d930f78
Compare
The following is the coverage report on the affected files.
|
|
||
- For standalone `TaskRuns` (that is, ones not executing as part of a `Pipeline`), labels | ||
propagate from the [referenced `Task`](taskruns.md#specifying-the-target-task), if one exists, to | ||
the corresponding `TaskRun`, and then to the associated `Pod`. | ||
the corresponding `TaskRun`, and then to the associated `Pod`. The same as above applies. | ||
|
||
- For `Conditions`, labels propagate to the corresponding `TaskRuns`, and then to the associated `Pods`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a doc for the same behavior on labels, should we rewrite this one to be labels and annotations ?
/cc @pritidesai @afrittoli @bobcatfish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup indeed, lets be specific and document labels and annotations both. Also the doc can be updated to include an example!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@Tomcli @rafalbigaj please confirm this new behavior for your use cases 🙏 |
For Kubeflow pipeline on Tekton, we were expecting PipelineRun labels/annotations to take precedences over its child resources. @rafalbigaj I believe that was your expected behavior as well? |
d930f78
to
b3cbe87
Compare
/hold cancel |
The following is the coverage report on the affected files.
|
/retest |
1 similar comment
/retest |
b3cbe87
to
9500f24
Compare
The following is the coverage report on the affected files.
|
/retest |
docs/labels.md
Outdated
the associated `Pods`. If a annotation is present in both `Pipeline` and | ||
`PipelineRun`, the annotation in `PipelineRun` takes precedence. | ||
|
||
- Labels from `Tasks` referenced by `TaskRuns` within a `PipelineRun` propagate to the corresponding `TaskRuns`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one last copy past issue here 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you @vdemeester 👍
For annotations and labels, do not override the Run metadata with the definition (Pipeline/Task) if they are the same. If an annotation or label is present in both Pipeline and PipelineRun, the value in the Run type takes precedence (same for Task and TaskRun). Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
9500f24
to
0c07604
Compare
The following is the coverage report on the affected files.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @vdemeester 😀
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop, pritidesai The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@vdemeester : I noticed a side effect of this change that I was wondering if it was expected behavior. It's stated that PipelineRuns take precedence over Pipeline labels and annotations (L&As) and TaskRuns take precedence over Task labels and annotations. In v0.34.1, I'm seeing that the TaskRuns that are created by the PipelineRuns inherit the L&As of the respective PipelineRun that created it, which has the side effect of overriding any of the explicit L&As that i set on the associated Tasks. The following is my general workflow.
When i inspect the pod associated to the I could probably code around this, but I wanted to confirm whether the cross-over metadata propagation between PipelineRun -> TaskRun was by design and was not overlooked as a potential bug. Thanks! |
Hey @hrivera-ntap, yes this is by design, the value from the Run taks precedence over the one defined in the |
Changes
For annotations and labels, do not override the Run metadata with the
definition (Pipeline/Task) if they are the same. If an annotation or
label is present in both Pipeline and PipelineRun, the value in the
Run type takes precedence (same for Task and TaskRun).
Closes #4636
Signed-off-by: Vincent Demeester vdemeest@redhat.com
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes