Treat error decoding a mutating webhook patch as error calling the webhook
Co-Authored-By: Matthew Wong <mattwon@amazon.com> Signed-off-by: Davanum Srinivas <davanum@gmail.com> Kubernetes-commit: cf82fd7e9ceac60b7a336c90958835865c4f2f0a
This commit is contained in:
parent
23913f0bf4
commit
0f91510ab0
|
@ -335,7 +335,7 @@ func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admiss
|
|||
}
|
||||
patchObj, err := jsonpatch.DecodePatch(result.Patch)
|
||||
if err != nil {
|
||||
return false, apierrors.NewInternalError(err)
|
||||
return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: fmt.Errorf("received undecodable patch in webhook response: %w", err), Status: apierrors.NewServiceUnavailable("error decoding patch in webhook response")}
|
||||
}
|
||||
|
||||
if len(patchObj) == 0 {
|
||||
|
|
Loading…
Reference in New Issue