Retry ArgocdRoleBinding reconcile if role doesn't exist yet #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Karl Taylor [email protected]
What type of PR is this?
What does this PR do / why we need it:
When creating an
ArgoCDRoleBindingif 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
ArgoCDRolefirst, and then the binding. No such order requirement exists for native KubernetesClusterRole/ClusterRoleBinding, or this project's ownArgoCDProjectRoleandArgoCDProjectRoleBinding(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.