Skip to content

Commit f61e953

Browse files
author
Eric Abramov
committed
⚠️ admission responses with raw Status
If a custom webhook validator returns a metav1.Status object as the error, the validation handler will build an admission response with this Status object as is, instead of building a new Status object based on err.Error() This might be considered as a breaking change since the behaviour of the validation handler is going to be slightly different from what the users might expect based on the previous version of the code
1 parent 2c49665 commit f61e953

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

pkg/webhook/admission/response.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ func ValidationResponse(allowed bool, reason string) Response {
8080
return resp
8181
}
8282

83-
// ValidationResponseFromStatus returns a response for admitting a request with provided Status object.
84-
func ValidationResponseFromStatus(allowed bool, status *metav1.Status) Response {
85-
resp := Response{
86-
AdmissionResponse: admissionv1beta1.AdmissionResponse{
87-
Allowed: allowed,
88-
Result: status,
89-
},
90-
}
91-
return resp
92-
}
93-
9483
// PatchResponseFromRaw takes 2 byte arrays and returns a new response with json patch.
9584
// The original object should be passed in as raw bytes to avoid the roundtripping problem
9685
// described in https://github.com/kubernetes-sigs/kubebuilder/issues/510.

0 commit comments

Comments
 (0)