-
Notifications
You must be signed in to change notification settings - Fork 448
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
Make the k8s store properly patch annotations #740
Conversation
Code looks good to me. @sandhose How to test this feature? |
This look good, i want a quick patch on this |
Previously it tried to replace the whole object, which might cause issues with newer versions of Kubernetes.
15cccd7
to
5e2486f
Compare
@sandhose let me know when you're ready for another review (I saw you pushed an updated but it didn't fixed my comments). If you're interested this is what I had in mind to simplify this PR: sgotti@de8eddd Please also update the commit message to follow our conventions and better describe what this patch does:
|
@sandhose I came across a similar issue when I was trying to deploy stolon, and this PR definitely solved it on my end - thank you very much! (tried on v0.15.0) |
@sgotti Thanks for picking that up, I really did not had time to finish this those past weeks |
@sandhose Thanks to you! I left you as the author of the commit in the new PR. |
Hi,
While trying out Stolon on Kubernetes, I ran into a weird issue where Stolon was unable to change the annotations on the sentinel and keeper pods. The api-server said it was trying to change some fields that were immutable. This was due to Stolon trying to replace the whole pod object instead of patching it.
This PRs changes the k8s store to properly use jsonpatch to set the annotations. This is heavily inspired by the way
kubectl annotate
does patch the annotations: https://github.com/kubernetes/kubectl/blob/b909fcb4a071a1a9669a9fe1f48482c848823124/pkg/cmd/annotate/annotate.go#L277-L311