From 0dee8016e21cba0e455d36dd45b49b8b532ca1bc Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sat, 27 Jan 2018 16:30:19 -0800 Subject: [PATCH] Support Create & Update operations in admission webhook (#312) --- pkg/admission/plugin/admission.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/admission/plugin/admission.go b/pkg/admission/plugin/admission.go index 6ff244552..be5f22b18 100644 --- a/pkg/admission/plugin/admission.go +++ b/pkg/admission/plugin/admission.go @@ -28,7 +28,7 @@ func (a *AdmissionHook) Validate(req *admission.AdmissionRequest) *admission.Adm status := &admission.AdmissionResponse{} supportedKinds := sets.NewString(api.ResourceKindRestic, api.ResourceKindRecovery) - if req.Operation != admission.Create || + if (req.Operation != admission.Create && req.Operation != admission.Update) || len(req.SubResource) != 0 || req.Kind.Group != api.SchemeGroupVersion.Group || !supportedKinds.Has(req.Kind.Kind) {