Fix api installer to indicate PATCH may return a 201 for server side apply

Kubernetes-commit: cb72ce975630b44ec8786d5b72b1e0ee8bb1a0e4
This commit is contained in:
Brendan Burns 2021-03-11 17:06:33 +00:00 committed by Kubernetes Publisher
parent faa33164d5
commit 3ba2299cd2
1 changed files with 2 additions and 0 deletions

View File

@ -805,6 +805,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Operation("patch"+namespaced+kind+strings.Title(subresource)+operationSuffix).
Produces(append(storageMeta.ProducesMIMETypes(action.Verb), mediaTypes...)...).
Returns(http.StatusOK, "OK", producedObject).
// Patch can return 201 when a server side apply is requested
Returns(http.StatusCreated, "Created", producedObject).
Reads(metav1.Patch{}).
Writes(producedObject)
if err := AddObjectParams(ws, route, versionedPatchOptions); err != nil {