From 5621f05378f68f1b28a9d15449a3800c40e717bc Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 26 Sep 2017 22:31:19 -0700 Subject: [PATCH] Add 201/202 to the list of returned codes. Kubernetes-commit: 449082f55d323bf4acf6963c4d093c044742762c --- pkg/endpoints/installer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/endpoints/installer.go b/pkg/endpoints/installer.go index 94495d886..08fb27108 100644 --- a/pkg/endpoints/installer.go +++ b/pkg/endpoints/installer.go @@ -678,6 +678,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag Operation("replace"+namespaced+kind+strings.Title(subresource)+operationSuffix). Produces(append(storageMeta.ProducesMIMETypes(action.Verb), mediaTypes...)...). Returns(http.StatusOK, "OK", producedObject). + // TODO: in some cases, the API may return a v1.Status instead of the versioned object + // but currently go-restful can't handle multiple different objects being returned. + Returns(http.StatusCreated, "Created", producedObject). Reads(defaultVersionedObject). Writes(producedObject) addParams(route, action.Params) @@ -718,6 +721,10 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag Operation("create"+namespaced+kind+strings.Title(subresource)+operationSuffix). Produces(append(storageMeta.ProducesMIMETypes(action.Verb), mediaTypes...)...). Returns(http.StatusOK, "OK", producedObject). + // TODO: in some cases, the API may return a v1.Status instead of the versioned object + // but currently go-restful can't handle multiple different objects being returned. + Returns(http.StatusCreated, "Created", producedObject). + Returns(http.StatusAccepted, "Accepted", producedObject). Reads(defaultVersionedObject). Writes(producedObject) addParams(route, action.Params)