kopf icon indicating copy to clipboard operation
kopf copied to clipboard

Finalizer Improvement suggestion

Open liviozanol opened this issue 1 year ago • 0 comments

As we know from this previous issue, kopf will fail to send large requests to K8S API (actually k8s API does not support it).

My suggestion is that when removing the finalizer, in fact just send the patch removing the finalizer itself instead of the entire pod spec. That will avoid the failure due to large request....

Ref: https://github.com/nolar/kopf/blob/c158baee82486b731496c7eec01fe60fcea2efce/kopf/_cogs/structs/finalizers.py#L37

If this was python k8s API it would be something like (if not other finalizer):

               self.v1.patch_namespaced_pod(pod, ns, body={
                    "metadata": {
                        "finalizers": None
                    }
                })

liviozanol avatar Nov 22 '24 16:11 liviozanol