You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In admission v1, API server requires that Patch and PatchType are both
provided or none are provided. Meanwhile, admission v1beta1 does not
have this kind of requirement.
In controller-runtime, PatchResponseFromRaw sets PatchType regardless
of the existence of patch. If patch is empty, a response contains
only PatchType and API server does not like it. Webhook call fails.
This change fixes this issue by not setting PatchType if patch is
empty.
Fixeskubernetes-sigs#1295
In admission v1, api server requires that patch and patchType are both provided or none are provided:
https://github.com/kubernetes/apiserver/blob/6d407d18a284aae4db693a8a50ca3647cc3ad429/pkg/admission/plugin/webhook/request/admissionreview.go#L67-L73
admission v1beta1 does not have this kind of requirement.
In controller-runtime, PatchResponseFromRaw sets patchType regardless of existence of patch:
controller-runtime/pkg/webhook/admission/response.go
Line 94 in 5720da0
So if patch is empty, a response contains only patchType and api server does not like it. Webhook call fails.
To make transition from admission v1beta1 to v1 smooth, it would be nice to set patchType only when patch is not empty, like so:
The text was updated successfully, but these errors were encountered: