Merge pull request #100141 from brendandburns/master

Fix api installer to indicate PATCH may return a 201 for server side apply
This commit is contained in:
Kubernetes Prow Robot 2021-04-09 05:18:47 -07:00 committed by GitHub
commit e5e18d5266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 740 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

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