{"action":"created","issue":{"url":"https://api.github.com/repos/abonas/kubeclient/issues/161","repository_url":"https://api.github.com/repos/abonas/kubeclient","labels_url":"https://api.github.com/repos/abonas/kubeclient/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/abonas/kubeclient/issues/161/comments","events_url":"https://api.github.com/repos/abonas/kubeclient/issues/161/events","html_url":"https://github.com/abonas/kubeclient/pull/161","id":142947848,"number":161,"title":"Add support for Patch method","user":{"login":"zakiva","id":11769555,"avatar_url":"https://avatars.githubusercontent.com/u/11769555?v=3","gravatar_id":"","url":"https://api.github.com/users/zakiva","html_url":"https://github.com/zakiva","followers_url":"https://api.github.com/users/zakiva/followers","following_url":"https://api.github.com/users/zakiva/following{/other_user}","gists_url":"https://api.github.com/users/zakiva/gists{/gist_id}","starred_url":"https://api.github.com/users/zakiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakiva/subscriptions","organizations_url":"https://api.github.com/users/zakiva/orgs","repos_url":"https://api.github.com/users/zakiva/repos","events_url":"https://api.github.com/users/zakiva/events{/privacy}","received_events_url":"https://api.github.com/users/zakiva/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-23T12:31:51Z","updated_at":"2016-03-24T07:53:54Z","closed_at":"2016-03-24T07:53:54Z","pull_request":{"url":"https://api.github.com/repos/abonas/kubeclient/pulls/161","html_url":"https://github.com/abonas/kubeclient/pull/161","diff_url":"https://github.com/abonas/kubeclient/pull/161.diff","patch_url":"https://github.com/abonas/kubeclient/pull/161.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/abonas/kubeclient/issues/comments/200716256","html_url":"https://github.com/abonas/kubeclient/pull/161#issuecomment-200716256","issue_url":"https://api.github.com/repos/abonas/kubeclient/issues/161","id":200716256,"user":{"login":"abonas","id":6277245,"avatar_url":"https://avatars.githubusercontent.com/u/6277245?v=3","gravatar_id":"","url":"https://api.github.com/users/abonas","html_url":"https://github.com/abonas","followers_url":"https://api.github.com/users/abonas/followers","following_url":"https://api.github.com/users/abonas/following{/other_user}","gists_url":"https://api.github.com/users/abonas/gists{/gist_id}","starred_url":"https://api.github.com/users/abonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abonas/subscriptions","organizations_url":"https://api.github.com/users/abonas/orgs","repos_url":"https://api.github.com/users/abonas/repos","events_url":"https://api.github.com/users/abonas/events{/privacy}","received_events_url":"https://api.github.com/users/abonas/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T07:53:54Z","updated_at":"2016-03-24T07:53:54Z","body":"> the client already provides the update_X methods with PUT, why the patch is needed in addition to it?\r\n> http://restcookbook.com/HTTP%20Methods/patch/\r\n> \r\n> when you only need to update one field of the resource, PUTting a complete resource representation might be cumbersome and utilizes more bandwidth (you have to GET and PUT)\r\n> \r\n> patching is done atomically on the server side (no risk for races with other concurrent GET/PUT)\r\n> \r\n> kubernetes and openshift are supporting it both server side and on their clients (kubectl patch and oc patch), we should close this gap here.\r\n> \r\n> do all the entities support PATCH on k8s client side? (didn't see a definitive answer in the docs)\r\n> As any other rest-api call it can fail server-side for several reasons. What if it's supported but the user has no permissions to update the entity. We shouldn't enforce any policy on the client side.\r\n> If an entity has no patch support it will fail.\r\n\r\nyes that is obvious that the server can fail any request for any particular reason and the client doesn't enforce it. my point was that if only one entity supports it on server side, I don't see any reason adding a \"massive\" support for it for all entities.\r\n \r\n> how the users will differ update_X from patch_X and know when to use which? maybe better names are required, if indeed this functionality shall be added to the client.\r\n> Update is replacing the entire entity and patch is just a diff that gets applied atomically. The user will use pick the one which is relevant for his use-case.\r\n> \r\n> \"Patch\" is called patch in rest-api, in rest-client, in kubernetes and openshift (both server and client) so I don't think we should change its name.\r\n> \r\n> On the other hand, what we call \"update\" is called \"replace\" in kubernetes:\r\n> \r\n> $ kubectl help\r\n> ...\r\n>   create         Create a resource by filename or stdin\r\n>   replace        Replace a resource by filename or stdin.\r\n>   patch          Update field(s) of a resource using strategic merge patch.\r\n> Although I am fine to keep the existing method with the current name \"update\".\r\n\r\nyes, I would not rename the existing update methods not to break existing users.\r\n\r\nI am missing tests and additions to readme in this patch."}}