From df7f96fc209cabf73eeb4fa29bf4cbbabe3a2f4d Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Tue, 27 Feb 2018 21:48:22 -0500 Subject: [PATCH] Allow update/patch of CRD while terminating --- .../pkg/apiserver/customresource_handler.go | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go index dda7d465c75..e427f4c117e 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go @@ -242,16 +242,8 @@ func (r *crdHandler) serveResource(w http.ResponseWriter, req *http.Request, req } return handlers.CreateResource(storage, requestScope, discovery.NewUnstructuredObjectTyper(nil), r.admission) case "update": - if terminating { - http.Error(w, fmt.Sprintf("%v not allowed while CustomResourceDefinition is terminating", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } return handlers.UpdateResource(storage, requestScope, discovery.NewUnstructuredObjectTyper(nil), r.admission) case "patch": - if terminating { - http.Error(w, fmt.Sprintf("%v not allowed while CustomResourceDefinition is terminating", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } return handlers.PatchResource(storage, requestScope, r.admission, unstructured.UnstructuredObjectConverter{}, supportedTypes) case "delete": allowsOptions := true @@ -273,16 +265,8 @@ func (r *crdHandler) serveStatus(w http.ResponseWriter, req *http.Request, reque case "get": return handlers.GetResource(storage, nil, requestScope) case "update": - if terminating { - http.Error(w, fmt.Sprintf("%v not allowed while CustomResourceDefinition is terminating", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } return handlers.UpdateResource(storage, requestScope, discovery.NewUnstructuredObjectTyper(nil), r.admission) case "patch": - if terminating { - http.Error(w, fmt.Sprintf("%v not allowed while CustomResourceDefinition is terminating", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } return handlers.PatchResource(storage, requestScope, r.admission, unstructured.UnstructuredObjectConverter{}, supportedTypes) default: http.Error(w, fmt.Sprintf("unhandled verb %q", requestInfo.Verb), http.StatusMethodNotAllowed) @@ -298,16 +282,8 @@ func (r *crdHandler) serveScale(w http.ResponseWriter, req *http.Request, reques case "get": return handlers.GetResource(storage, nil, requestScope) case "update": - if terminating { - http.Error(w, fmt.Sprintf("%v not allowed while CustomResourceDefinition is terminating", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } return handlers.UpdateResource(storage, requestScope, discovery.NewUnstructuredObjectTyper(nil), r.admission) case "patch": - if terminating { - http.Error(w, fmt.Sprintf("%v not allowed while CustomResourceDefinition is terminating", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } return handlers.PatchResource(storage, requestScope, r.admission, unstructured.UnstructuredObjectConverter{}, supportedTypes) default: http.Error(w, fmt.Sprintf("unhandled verb %q", requestInfo.Verb), http.StatusMethodNotAllowed)