-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Change AppliedWork to used foregroundDeletion #60
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
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Hi Britania! A side note: though the case we troubleshot was quite special, we probably still need to handle it as a corner case to avoid system being stuck forever -> it could be sent in a separate PR though. |
|
Added some comments, PTAL. |
6bc8746 to
82bd3ad
Compare
8332560 to
10311a3
Compare
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.
Pull Request Overview
This PR updates the deletion mechanism for applied work by switching to foreground deletion and adjusting owner reference behavior accordingly. Key changes include updating tests to verify work resource deletion, modifying BlockOwnerDeletion settings in owner references, and changing the deletion propagation policy in garbage collection.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/utils_test.go | Added waiting for work resource deletion and reset ResourceVersion in tests |
| test/e2e/placement_pickfixed_test.go | Added scenarios to simulate stuck deletions and verify proper finalizer management |
| test/e2e/placement_apply_strategy_test.go | Replaced inline owner reference definitions with a reusable variable and improved error messages |
| test/e2e/enveloped_object_placement_test.go | Minor adjustment to delete a second envelope resource |
| pkg/controllers/workapplier/preprocess.go | Removed unused import and updated owner reference equality checks in removal logic |
| pkg/controllers/workapplier/controller_test.go | Added tests for ClusterRole resources |
| pkg/controllers/workapplier/controller.go | Changed deletion propagation to foreground and updated owner reference settings |
…reference when co-ownership is allowed Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
dca21c5 to
c0c3243
Compare
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
michaelawyu
left a comment
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.
Added some comments, PTAL. Let me know if you'd like to discuss it a bit further.
| UID: appliedWork.UID, | ||
| } | ||
|
|
||
| for _, res := range appliedWork.Status.AppliedResources { |
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.
Hi Britania! This part might have some potential consistency issues; the AppliedResources on AppliedWork objects are updated only at the end of the reconciliation loop on a best effort basis; it might not incude all the applied manifests if, say, the status update is skipped/interruptted. The work object status is, instead, designed to be always consistent.
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.
can we make appliedResources accurate? I thought we rely on this to remove resources from the member cluster
| UID: appliedWork.UID, | ||
| } | ||
|
|
||
| for _, res := range appliedWork.Status.AppliedResources { |
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.
can we make appliedResources accurate? I thought we rely on this to remove resources from the member cluster
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Description of your changes
Fixes #
I have:
now track work that is deleting by using Foreground deletion mode on applied work
update the owner reference to not block applied work deletion when there is co-ownership.
Run
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer
References: