-
Notifications
You must be signed in to change notification settings - Fork 49
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
Remove optimistic lock on Patch #350
Conversation
Interesting - my apologies on this. I thought we'd want to always operate on the latest version of the objects. |
I thought to. But It seems that with the Optimistic Lock, it does the same thing than an Update. But with a simple Patch, it should only update what we want to update no? Even if its not the latest version of the resource, the Patch will only change what has change, no? |
This is true with the exception of lists:
source: The work around is to use strategic merge, but those don't work with CRDs. So this is something we need to be conscious of in the operator -- lists will be replaced so we need to compute entirely new lists and not just additions/subtractions. I had to do this in the |
Should I put back |
I only put that in there to guarantee its patching the latest version of objects. Since we didn't see any issues with that (right?), perhaps we do leave in the optimistic lock. |
1 similar comment
I only put that in there to guarantee its patching the latest version of objects. Since we didn't see any issues with that (right?), perhaps we do leave in the optimistic lock. |
I don't think so, I will put it back. |
2387e87
to
80c46e2
Compare
I'm going to merge and we should monitor for any issues in the next release. |
What's in this PR?
Removal of the Optimistic Lock on Patch.
Why?
With it, the change from Update to Patch, doesn't improve the error linked to the update on older resource version.
But without it, the error disappears.
And this should prevent the dataflow deployment duplication error.
In the Operator SDK documentation, they seems to favorite this: https://sdk.operatorframework.io/docs/building-operators/golang/references/client/#patch.
Checklist