-
Notifications
You must be signed in to change notification settings - Fork 51
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
Replace Update by Patch on K8S resource #333
Replace Update by Patch on K8S resource #333
Conversation
Should we patch everywhere instead of updating to avoid these errors? If so, should we consider cases where nifikop updates k8s resources? https://github.com/konpyutaika/nifikop/blob/master/pkg/k8sutil/resource.go#L111 |
Co-authored-by: Michael H <[email protected]>
Not necessarily, I don't think that is necessary to patch instead of update the resources owned by NiFiKop and only manipulated by NiFiKop. The issue with the CRD, it's that they can be modified by pretty much everything like a chart HELM, Keda or even NiFiKop itself by another controller. So my changes are aimed at getting controllers to patch their resources so they won't be affected by the rest. But maybe, I'm wrong and I'm missing something 🤔. And the work to change the Update to Patch can be heavy because you need to pass the patcher to it. But again maybe, the implementation I did is not the most effecient one 🤔. So if you see a way to do it more easly, let me know, I'm interested 😁. |
That's reasonable. The resources nifikop creates/manages wouldn't also be managed by ArgoCD, Helm CLI, etc. I can't think of a better way, to be honest. You need to capture the patch from the original object and carry it through until you apply the patch so that does make code changes fairly significant. |
….com:konpyutaika/nifikop into feat/replace_update_by_patch_on_k8s_resource
LGTM! Merge at your leisure |
What's in this PR?
Changes to replace Update instructions by Patch instructions on K8S resources.
Why?
To prevent errors due to simultaneous updates.
Checklist