-
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: prevent modification of annotations on completed TaskRuns #7603
fix: prevent modification of annotations on completed TaskRuns #7603
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
8da0ef7
to
7fd3ae4
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.
/ok-to-test
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.
This is most likely going to be a problem as some things need to update annotations once the TaskRun or PipelineRun is done. An example is the chains component that signs outputs once the run is done and adds annotations to the object once signed.
cc @tektoncd/core-maintainers @tektoncd/chains-maintainers
Yup! I believe this is also true for the Tekton Results project. cc @tektoncd/results-maintainers @l-qing, could provide more context on why the suggested changes are desired? |
7fd3ae4
to
469906f
Compare
As described above: After upgrading the Pipeline, I found that the Annotations I might not be very familiar with tekton result. pipeline/pkg/reconciler/taskrun/taskrun.go Lines 107 to 155 in e1c7828
I have updated the description to elucidate the impact. pipeline/pkg/reconciler/taskrun/taskrun.go Lines 310 to 313 in 469906f
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@l-qing chains doesn't act "until" the taskrun is done (see here), and will put an annotation on it (see here). I didn't see it as obvious as this in the That said, given your usecase, we probably want to disallow mutating some of the annotations (or ignore these mutation), and essentially, |
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.
@vdemeester
I don't think this PR stops tekton-chains or tekton-results from adding annotations. It just blocks this function
pipeline/pkg/reconciler/taskrun/taskrun.go
Line 650 in 39cdda0
func (c *Reconciler) updateLabelsAndAnnotations(ctx context.Context, tr *v1.TaskRun) (*v1.TaskRun, error) { |
Changes aren't in the validator code but reconciler. It's okay if the annotation for a completed pipelinerun/taskrun is not updated by the pipeline controllers.
Is my understanding correct, @l-qing ?
/test pull-tekton-pipeline-unit-tests |
469906f
to
09e2c7d
Compare
Yes, that's exactly what I mean. In the reconcile of the PipelineRun, I noticed that there is no location where the |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Ah I mis-read the PR then. It's preventing the pipeline controller itself to updated labels and annotations once the run is done 👍🏼. Then yes, it shouldn't be a problem ! /approve |
09e2c7d
to
f48148b
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
f48148b
to
c8588bd
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
c8588bd
to
c44ef71
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
c44ef71
to
e00833b
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
In TaskRun, the annotation `pipeline.tekton.dev/release` records the version information of the pipeline. If the Pipeline is updated, the annotation in the completed TaskRuns should not be modified.
e00833b
to
4923478
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest-required |
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 @l-qing - I updated the release note to make it a bit clearer that this is only preventing modification of the annotations that are set by the pipeline controller.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom, vdemeester 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 |
Thanks! |
In TaskRun, the annotation
pipeline.tekton.dev/release
records the version information of the pipeline. If the Pipeline is updated, the annotation in the completed TaskRuns should not be modified.pipeline/pkg/reconciler/taskrun/taskrun.go
Lines 142 to 155 in e1c7828
pipeline/pkg/reconciler/taskrun/taskrun.go
Lines 295 to 319 in e1c7828
pipeline/pkg/reconciler/taskrun/taskrun.go
Lines 650 to 657 in e1c7828
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind bug