Fix retry in update critical annotations after a confict #594
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.
Description of your changes
This PR fixes retry in updating critical annotations under a specific circumstance where the Update attempt returns a conflict. Presumably introduced with this PR, we hide the conflict error when we have a successful get afterward, which causes not retrying to persist critical annotations.
Related issue: crossplane-contrib/provider-upjet-azure#577
I have:
make reviewable testto ensure this PR is ready for review.How has this code been tested
Added unit test to catch the specific scenario.
Also tested with
ResourceGroupwith provider-azurev0.38.0. The resource becomes ready/synced with this PR, even though it throws that event* 2 times before the retries doing its job and eventually persisting thecrossplane.io/external-create-succeededannotation. The question of why we try to reconcile two times before the first reconciliation returns is another question that needs to be investigated separately - I'll create a ticket to follow up.*
cannot determine creation result - remove the crossplane.io/external-create-pending annotation if it is safe to proceed