diff --git a/pkg/api/unversioned.go b/pkg/api/unversioned.go index 9a531326851..86c9bcd07ec 100644 --- a/pkg/api/unversioned.go +++ b/pkg/api/unversioned.go @@ -64,3 +64,6 @@ func (apiVersions APIVersions) String() string { func (apiVersions APIVersions) GoString() string { return apiVersions.String() } + +// Patch is provided to give a concrete name and type to the Kubernetes PATCH request body. +type Patch struct{} diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index 261b34da6da..f4d5aae1a5e 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -447,8 +447,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag Consumes(string(api.JSONPatchType), string(api.MergePatchType), string(api.StrategicMergePatchType)). Operation("patch"+kind+strings.Title(subresource)). Produces(append(storageMeta.ProducesMIMETypes(action.Verb), "application/json")...). - Returns(http.StatusOK, "OK", "string"). - Reads("string"). + Returns(http.StatusOK, "OK", versionedObject). + Reads(api.Patch{}). Writes(versionedObject) addParams(route, action.Params) ws.Route(route)