mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 18:09:57 +00:00
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 #1203 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Jian Qiu <jqiu@redhat.com> Co-authored-by: Claude <noreply@anthropic.com>