diff --git a/pkg/webhook/admission/response.go b/pkg/webhook/admission/response.go index 541118498b..24ff1dee3c 100644 --- a/pkg/webhook/admission/response.go +++ b/pkg/webhook/admission/response.go @@ -90,8 +90,14 @@ func PatchResponseFromRaw(original, current []byte) Response { return Response{ Patches: patches, AdmissionResponse: admissionv1.AdmissionResponse{ - Allowed: true, - PatchType: func() *admissionv1.PatchType { pt := admissionv1.PatchTypeJSONPatch; return &pt }(), + Allowed: true, + PatchType: func() *admissionv1.PatchType { + if len(patches) == 0 { + return nil + } + pt := admissionv1.PatchTypeJSONPatch + return &pt + }(), }, } }