Apply Provisioned condition with SSA#9842
Conversation
We noticed a very frequent conflict when adding a Provisioned condition to the ProvisioningRequest. That usually happens in best-effort-atomic PRs, where CA adds Accepted and then Provisioned conditions in a very quick succession. The informer cache does not catch up with the first update, and therefore a conflict is detected during the second update. SSA fixes that, as it allows to update a single condition without a risk of conflict. This solution is preferred over a retry loop, since the API calls run synchronously in the CA main loop. Strategic merge patch could not be used, since it's not supported with CRDs. JSON merge patch replaces the entire conditions list. That leaves SSA an only viable solution. Note: that fixes only the most frequently detected race condition. Eventually, all PR condition updates should be migrated to SSA.
9ce7389 to
d453489
Compare
|
/triage accepted |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jackfrancis, norbertcyran The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@norbertcyran: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
We noticed a very frequent conflict when adding a Provisioned condition to the ProvisioningRequest. That usually happens in best-effort-atomic PRs, where CA adds Accepted and then Provisioned conditions in a very quick succession. The informer cache does not catch up with the first update, and therefore a conflict is detected during the second update. SSA fixes that, as it allows to update a single condition without a risk of conflict. This solution is preferred over a retry loop, since the API calls run synchronously in the CA main loop. Strategic merge patch could not be used, since it's not supported with CRDs. JSON merge patch replaces the entire conditions list. That leaves SSA an only viable solution. Note: that fixes only the most frequently detected race condition. Eventually, all PR condition updates should be migrated to SSA.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: