-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix deletion when TaskRun is part of PipelineRun #690
Conversation
The following is the coverage report on the affected files.
|
/lgtm |
@Roming22: changing LGTM is restricted to collaborators 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. |
to be clear @sayan-biswas , and apologies if you feel it is too obvious, but rather then updating with a "pending" status for the task, can you explicitly state what updates if any the pipeline controller should make on the PipelineRun object for the task? some status of "deleted" ? Among other things I am curious because of the need to handle the deletion of taskruns owned by pipelineruns that are still alive in some other scenarios. Also, coming in new to this, I am a bit curious why we might not ever want to always honor the owner ref ... is it to simply speed up pruning ? |
@gabemontero As per my understanding, the pipeline controller propagates the status of the child TaskRuns to the parent PipelineRun object when it changes. But in this case, by design, deletion of TaskRun will trigger a reconciliation but I don't get what is the point of updating the parent PipelineRun object to "Pending", is it not possible to keep it as it is. |
We have PipelineRuns that have an ownerRef. Those PipelineRuns are not being pruned, and end up polluting the namespace. |
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.
Code changes look good - I found that some of the comments in the test code need to be fixed as the comment does not match the logic in the test.
Otherwise my concerns fall into the general "code hygiene" category:
- Include a body in the commit message that explains the what and why of the change. See the Tekton commit message standards
- Fill in the release note of the pull request description - this is a behavior change that warrants a release note.
t.Fatal(err) | ||
} | ||
|
||
// Make sure that the resource no longer exists |
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.
Fix comment - resource should exist.
There are other identical comments that should be corrected - appears to be a copy/paste issue.
// Make sure that the resource no longer exists | |
// Make sure the TaskRun is not deleted |
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.
Done
I'm setting aside user-facing docs concerns, as we really don't have great documentation today. |
Does this fix #689? |
27e86f8
to
1a9b77c
Compare
The following is the coverage report on the affected files.
|
Yes. |
In case a TaskRun is initiated by a PipelineRun, the ownerRef is internally used by the pipeline controller to create dependency. In these cases, we don't want the TaskRuns to be deleted separately.
1a9b77c
to
74ae852
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adambkaplan, Roming22, 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 |
Fixes #689
Changes
Prevent deletion of any object OwnerRef check is disabled and yet the object has a PipelineRun as owner ref.
This is needed because the Pipeline Controller doesn't handle the edge case where the child TaskRun can be deleted without deleting the parent PipelineRun, and as a result the deletion causes the PipelineRun object to get updated with a "Pending" status for that task.
If an aggressive pruning is required, this can be removed in future once the above scenario is handled by the Pipeline Controller.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you review them:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes