-
Notifications
You must be signed in to change notification settings - Fork 54
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
Object has been modified while testing out a ClusterExtension #1414
Comments
/assign |
Can you include the version of operator-controller and more logging context. I'm not sure that SSA is a sufficient solution for this problem. The error is telling us that the status that we're trying to write doesn't actually "go with" the current state of the object, which has changed since we last read it. In order to write the correct status, we need to requeue and fetch again anyway. Having said that, I would only expect this error to happen in the following scenario
In that scenario, I would expect us to requeue and try again (which is what we do now). But if we're seeing this error in other scenarios, that points to an issue in the way that we are sending updates to the apiserver for an object. |
…d data consistency The error `the object has been modified; please apply your changes to the latest version and try again` occurs when we attempt to update a resource that has changed since it was initially fetched. These changes ensure that we fetch the current state of the resource just before issuing updates, rather than using the version obtained at the start of reconciliation. Additionally: - Deep copy the ClusterExtension object before reconciliation to preserve the original state. - Re-fetch the latest resource version before updating status and finalizers to handle conflicts from concurrent updates. Closes: operator-framework#1414
…lution and data consistency The error `the object has been modified; please apply your changes to the latest version and try again` occurs when we attempt to update a resource that has changed since it was initially fetched. These changes ensure that we fetch the current state of the resource just before issuing updates, rather than using the version obtained at the start of reconciliation. Closes: operator-framework#1414
Code ref: https://github.com/operator-framework/operator-controller/blob/main/internal/controllers/clusterextension_controller.go#L132
Suggested approaches:
resourceVersion
is in sync [1][1] https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes
[2] https://kubernetes.io/docs/reference/using-api/server-side-apply/
[3] kubernetes-sigs/controller-runtime#347
The text was updated successfully, but these errors were encountered: