-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 reconciler/apibinding: make group resources of APIBindings + CRD race-free #3251
base: main
Are you sure you want to change the base?
Conversation
90885fe
to
e338b59
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
93f12c1
to
8ba5890
Compare
/retest |
… exports Signed-off-by: Dr. Stefan Schimanski <[email protected]>
e20f05d
to
3f47600
Compare
…lCluster Signed-off-by: Dr. Stefan Schimanski <[email protected]>
3f47600
to
facb4eb
Compare
/build-image |
PR needs rebase. Instructions 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/test-infra repository. |
/cc |
Summary
The conflict checker in the APIBinding reconciler computed a list of CRDs, both real and bound ones. It took the APIExport as reference instead of the bindings directly. This seems wrong. If a schema is removed from an export, or the whole export is deleted, the binding still exists, but it didn't contribute the conflict checker anymore.
This PR does the following:
APIBinding.status.boundResources
as reference.apis.kcp.io/resource-bindings
annotation on theLogicalCluster
. It records the APIBinding or whether it is a CRD. This annotation (a JSON map) is updated BEFORE (a) a CRD is created (admission) or (b) an APIBinding bind the group resource:The tricky case is that we can only update the annotation during CRD creation via admission. And creation can fail. Then we have a dangling group resource reservation. This PR adds an expery timestamp to the group resource entries for CRD which matches the maximum request duration of 30s. For that time an APIBinding of the same group resource would fail (delayed). Don't know a better way to solve that.
Downside: CRD creation implies update of the
LogicalCluster
, with potential for conflicts. This might make CRD creation slower. So if you install 1000 CRDs, this PR will have an impact.Related issue(s)
Fixes #3252
Release Notes