-
Notifications
You must be signed in to change notification settings - Fork 112
🐛 Fix ManifestWorkReplicaSet not deleting ManifestWorks from old placement #1206
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
base: main
Are you sure you want to change the base?
🐛 Fix ManifestWorkReplicaSet not deleting ManifestWorks from old placement #1206
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiujian16 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 |
WalkthroughAdds a reconcile-time cleanup that deletes ManifestWorks tied to placements no longer referenced by a ManifestWorkReplicaSet. Introduces unit tests for single and multiple placement changes and an integration test validating deletion and recreation behavior when the placementRef set changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (3)pkg/work/hub/controllers/manifestworkreplicasetcontroller/manifestworkreplicaset_deploy_test.go (2)
pkg/work/hub/controllers/manifestworkreplicasetcontroller/manifestworkreplicaset_deploy_reconcile.go (1)
test/integration/work/manifestworkreplicaset_test.go (5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When a ManifestWorkReplicaSet's placementRef was changed, the ManifestWorks created for the old placement were not deleted, causing orphaned resources. The deployReconciler only processed placements currently in the spec and never cleaned up ManifestWorks from removed placements. This commit adds cleanup logic that: - Builds a set of current placement names from the spec - Lists all ManifestWorks belonging to the ManifestWorkReplicaSet - Deletes any ManifestWorks with placement labels not in current spec Also adds comprehensive tests: - Integration test verifying placement change cleanup - Unit tests for single and multiple placement change scenarios Fixes open-cluster-management-io#1203 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Jian Qiu <[email protected]>
01c6eef
to
4a101a8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1206 +/- ##
==========================================
- Coverage 61.33% 61.28% -0.06%
==========================================
Files 207 209 +2
Lines 20545 20881 +336
==========================================
+ Hits 12602 12797 +195
- Misses 6846 6967 +121
- Partials 1097 1117 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When a ManifestWorkReplicaSet's placementRef was changed, the ManifestWorks created for the old placement were not deleted, causing orphaned resources.
The deployReconciler only processed placements currently in the spec and never cleaned up ManifestWorks from removed placements.
This commit adds cleanup logic that:
Also adds comprehensive tests:
Fixes #1203
🤖 Generated with Claude Code
Summary
Related issue(s)
Fixes #
Summary by CodeRabbit