From 5d919d693520a5e190fd00b1912ef98c6d755dd4 Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Wed, 4 Mar 2015 17:02:42 -0800 Subject: [PATCH] Specified that PUT is a replace and not an update. Fixes #3112. --- docs/api-conventions.md | 2 +- pkg/apiserver/api_installer.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api-conventions.md b/docs/api-conventions.md index 5194814c091..d18636c4bb5 100644 --- a/docs/api-conventions.md +++ b/docs/api-conventions.md @@ -88,7 +88,7 @@ When a new version of an object is POSTed or PUT, the "spec" is updated and avai The PUT and POST verbs on objects will ignore the "status" values. Otherwise, PUT expects the whole object to be specified. Therefore, if a field is omitted it is assumed that the client wants to clear that field's value. -Modification of just part of an object may be achieved by GETting the resource, modifying part of the spec, labels, or annotations, and then PUTting it back. See [concurrency control](#concurrency-control-and-consistency), below, regarding read-modify-write consistency when using this pattern. Some objects may expose alternative resource representations that allow mutation of the status, or performing custom actions on the object. +The PUT verb does not accept partial updates. Modification of just part of an object may be achieved by GETting the resource, modifying part of the spec, labels, or annotations, and then PUTting it back. See [concurrency control](#concurrency-control-and-consistency), below, regarding read-modify-write consistency when using this pattern. Some objects may expose alternative resource representations that allow mutation of the status, or performing custom actions on the object. All objects that represent a physical resource whose state may vary from the user's desired intent SHOULD have a "spec" and a "status". Objects whose state cannot vary from the user's desired intent MAY have only "spec", and MAY rename "spec" to a more appropriate name. diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index 9ccb315aa54..9f17f2396de 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -270,8 +270,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage RESTStorage case "PUT": // Update a resource. route := ws.PUT(action.Path).To(UpdateResource(updater, ctxFn, action.Namer, codec, resource, admit)). Filter(m). - Doc("update the specified " + kind). - Operation("update" + kind). + Doc("replace the specified " + kind). + Operation("replace" + kind). Reads(versionedObject) addParams(route, action.Params) ws.Route(route)