Repository navigation
fix(namespace-management): enqueue the instance when consent is withdrawn - #1613
Gabrielandre02 wants to merge 1 commit into
Conversation
…rawn Deleting a NamespaceManagement CR never enqueued the Argo CD instance it named: the delete predicate returned false on every path. Retargeting .spec.managedBy was dropped too whenever the predicate skipped or failed its own cleanup, e.g. when the managing namespace carries a matching managed-by label. The stale grants, such as the Image Updater manager RBAC in the target namespace, stayed until an unrelated reconcile. Enqueue on delete whenever the CR named an instance, and on update whenever .spec.managedBy changes, regardless of the predicate cleanup. The reconcile rebuilds consent and prunes what is no longer allowed. Status-only updates are still filtered out, so the reconcile's own status writes do not loop. Fixes redhat-developer#1530 Signed-off-by: gabriel.carmo <admin@gabrielandre.com.br>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Hi @Gabrielandre02. Thanks for your PR. I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1613 +/- ##
==========================================
- Coverage 70.82% 68.86% -1.96%
==========================================
Files 25 118 +93
Lines 3873 25318 +21445
==========================================
+ Hits 2743 17435 +14692
- Misses 1130 7883 +6753
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What does this PR do?
When a NamespaceManagement CR is deleted, the Argo CD instance it named is never enqueued. The delete predicate returns
falseon every path, so the mapper never runs. Retargeting.spec.managedByhas the same problem whenever the predicate skips or fails its own cleanup, for example when the managing namespace has a matchingmanaged-bylabel. Stale grants, such as the Image Updater manager Role and RoleBinding in the target namespace, then stay until some unrelated reconcile.With this change:
.spec.managedBychanges, whatever the predicate cleanup did.The reconcile already rebuilds consent and prunes what is no longer allowed, so it removes the stale RBAC. Status-only updates are still filtered out so the reconcile's own status writes don't loop.
Fixes #1530
PR acceptance criteria:
make serve-docs: not applicable, there is no user-facing change.What type of PR is this?
/kind bug
Special notes to the reviewer:
The tests are in a new file,
namespaceManagement_events_test.go:namespaceManagementFilterPredicate(), including the matchingmanaged-bylabel case and a status-only update. The four withdrawal cases fail onmaster.I also flipped the existing
HandleNamespaceManagementDeleteassertion fromFalsetoTrue.Falsewas the bug.I ran
go test ./controllers/argocd/,go vetandgofmt. I did not run the E2E suite.This overlaps with #1563 (#1559), which changes which namespace's labels the same two handlers check. I left those
Getcalls as they are, so whichever PR merges second will have a small conflict. I'm happy to rebase on top of #1563 if you'd rather merge that one first.