-
Notifications
You must be signed in to change notification settings - Fork 16
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
Quick subsequent reconciliations cause errors caused by using cached client #733
Comments
As a follow up to the conversation on Kubernetes slack: https://kubernetes.slack.com/archives/C02MRBMN00Z/p1728554873783249. A possible way forward (at least for the resources that are created against an external API like Konnect) we can implement a fallback lookup when 409 Conflict is returned. We could add filtering based on Kubernetes UID so that we're not "adopting" (separate issue #460) resources mapped from elsewhere. This could look like this (example for
|
This issue has dual nature behind it:
I hope that clears things up a bit w.r.t. where this issue belongs. |
This is complex issue. Let's see if users suffer from this problem before addressing it |
Problem statement
controller-runtime
(use by the operator) uses a cached client.This causes issues when quick, successive reconciliations of a resource happen and the subsequent iterations do not get an up to date view on an updated/patched object. For example:
Up until now, this has been taken care of by calling one of the
Reduce*()
helper functions which are aware of the objects' schema and their priorities so that surplus objects can be removed without consequences.With integration with external APIs (e.g. Konnect API in #370) this does not work as the resource is created in external API and more importantly the create API calls will result in
HTTP 409 Conflict
s.Exemplar logs
Proposed solution
Make use of expectations https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/controller_utils.go
Related material
https://www.youtube.com/watch?v=wMqzAOp15wo&t=748s
Acceptance criteria
The text was updated successfully, but these errors were encountered: