Skip to content

Conversation

@k4r1
Copy link
Contributor

@k4r1 k4r1 commented Jul 12, 2025

Signed-off-by: Karl Taylor [email protected]

What type of PR is this?

/kind bug

What does this PR do / why we need it:
When creating an ArgoCDRoleBinding if the role it is referring to doesn't exist (yet) then the reconciler will take no action but also never requeue it.

This creates an undesirable apply-order issue where you must create the ArgoCDRole first, and then the binding. No such order requirement exists for native Kubernetes ClusterRole/ClusterRoleBinding, or this project's own ArgoCDProjectRole and ArgoCDProjectRoleBinding (relevant code for when the role is not found is here). Therefore this looks more like a bug than intended behaviour.

How to test changes / Special notes to the reviewer:
To test, apply an ArgoCDRole and an ArgoCDRoleBinding to the cluster simultaneously. You will observe that the role binding often fails to take effect. With this change, the binding should be applied reliably.

@k4r1 k4r1 force-pushed the fix/role-binding-reconcile branch from 3ac45d7 to 3914bff Compare July 12, 2025 10:06
@k4r1 k4r1 marked this pull request as draft July 12, 2025 10:15
@k4r1 k4r1 marked this pull request as ready for review July 12, 2025 12:03
@ggkhrmv
Copy link
Collaborator

ggkhrmv commented Jul 15, 2025

LGTM, thank you @k4r1!

@ggkhrmv ggkhrmv merged commit c485f00 into argoproj-labs:main Jul 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants