Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not set PatchType if patch is empty
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.
- Loading branch information