-
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 Pipeline/Task to *Run label/annotation propagation 🥨 #4478
Fix Pipeline/Task to *Run label/annotation propagation 🥨 #4478
Conversation
The following is the coverage report on the affected files.
|
@@ -1147,10 +1130,28 @@ func (c *Reconciler) makeConditionCheckContainer(ctx context.Context, rprt *reso | |||
return &cc, err | |||
} | |||
|
|||
func storePipelineSpec(ctx context.Context, pr *v1beta1.PipelineRun, ps *v1beta1.PipelineSpec) error { | |||
func storePipelineSpecAndMergeMeta(ctx context.Context, pr *v1beta1.PipelineRun, ps *v1beta1.PipelineSpec, meta *metav1.ObjectMeta) error { |
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.
since we are updating this function here, please drop ctx
since its not used in this function
Before this fix, we are "forgetting" the Task and Pipeline metadata (Labels/Annotations) when using them in a Run (PipelineRun or TaskRun). It is however documented that those metadata get propagated to the generated Pod, and even the code after storing the Spec is written that way. Because we only store the spec, the second time we were reconciling the TaskRun or PipelineRun, we wouldn't fetch the referenced Task or Pipeline anymore, and thus, we would not propagate them. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
ee6ec91
to
111d059
Compare
The following is the coverage report on the affected files.
|
/retest |
/lgtm |
/lgtm |
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 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
Changes
Before this fix, we are "forgetting" the Task and Pipeline
metadata (Labels/Annotations) when using them in a Run (PipelineRun or
TaskRun).
It is however documented that those metadata get propagated to the
generated Pod, and even the code after storing the Spec is written
that way.
Because we only store the spec, the second time we were reconciling
the TaskRun or PipelineRun, we wouldn't fetch the referenced Task or
Pipeline anymore, and thus, we would not propagate them.
Fixes #4477
Signed-off-by: Vincent Demeester vdemeest@redhat.com
This most likely need an additional unit test or e2e test, I will be working on this 👼🏼
/kind bug
/cc @pritidesai @sbwsg @chmouel @bobcatfish
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes