{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/1642","labels_url":"https://api.github.com/repos/openshift/origin/issues/1642/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/1642/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/1642/events","html_url":"https://github.com/openshift/origin/issues/1642","id":67168747,"number":1642,"title":"osc update --patch doesn't work as advertised","user":{"login":"sosiouxme","id":29690,"avatar_url":"https://avatars.githubusercontent.com/u/29690?v=3","gravatar_id":"","url":"https://api.github.com/users/sosiouxme","html_url":"https://github.com/sosiouxme","followers_url":"https://api.github.com/users/sosiouxme/followers","following_url":"https://api.github.com/users/sosiouxme/following{/other_user}","gists_url":"https://api.github.com/users/sosiouxme/gists{/gist_id}","starred_url":"https://api.github.com/users/sosiouxme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sosiouxme/subscriptions","organizations_url":"https://api.github.com/users/sosiouxme/orgs","repos_url":"https://api.github.com/users/sosiouxme/repos","events_url":"https://api.github.com/users/sosiouxme/events{/privacy}","received_events_url":"https://api.github.com/users/sosiouxme/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openshift/origin/labels/cli","name":"cli","color":"666666"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-08T16:32:20Z","updated_at":"2015-04-17T21:14:44Z","closed_at":null,"body":"```\r\n$ _output/local/go/bin/osc  update -h\r\nUpdate a resource by filename or stdin.\r\n[...]\r\n\t# Update a pod by downloading it, applying the patch, then updating. Requires apiVersion be specified.\r\n\t$ osc update pods my-pod --patch='{ \"apiVersion\": \"v1beta1\", \"desiredState\": { \"manifest\": [{ \"cpu\": 100 }]}}'\r\n\r\nOptions:\r\n  -f, --filename=[]: Filename, directory, or URL to file to use to update the resource.\r\n      --patch='': A JSON document to override the existing resource. The resource is downloaded, patched with the JSON, then updated.\r\n```\r\n\r\nOK, let's try that out:\r\n\r\n```\r\n$ _output/local/go/bin/osc   get nodes\r\nNAME                LABELS                  STATUS\r\n172.16.4.110        region=infra,zone=NA    Schedulable,Ready\r\n172.16.4.113        region=normal,zone=z1   Schedulable,Ready\r\n172.16.4.146        region=normal,zone=z1   Schedulable,Ready\r\n172.16.4.152        region=normal,zone=z2   Schedulable,Ready\r\n172.16.4.158        region=normal,zone=z2   Schedulable,Ready\r\n172.16.4.159        region=infra,zone=NA    Schedulable,Ready\r\n$ cat > /tmp/foonode.json\r\n{                \r\n        \"apiVersion\": \"v1beta1\",\r\n        \"labels\": {\r\n                \"region\": \"infra\",\r\n                \"zone\": \"NA\",\r\n                \"foo\": \"bar\"\r\n            }\r\n}\r\n$ _output/local/go/bin/osc  update node 172.16.4.110 --patch=`cat /tmp/foonode.json`\r\nF0408 12:23:02.342063    3568 update.go:52] Error: Must provide resource and name command line params\r\nsee 'osc update -h' for help.\r\n```\r\n\r\nNow, it could easily be the case I did something wrong. But if so, it should tell me what that is, because I clearly followed the example and provided the parameters. If I need to add kind or name to the json, it should tell me that, not this. Or if the help is wrong, fix that and this message.\r\n\r\nWhile fixing this might be a good time to also have --patch support using -f to supply a filename? Putting JSON on the cmdline is awkward.\r\n"},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/94076952","html_url":"https://github.com/openshift/origin/issues/1642#issuecomment-94076952","issue_url":"https://api.github.com/repos/openshift/origin/issues/1642","id":94076952,"user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T21:14:44Z","updated_at":"2015-04-17T21:14:44Z","body":"Basically... dont try to edit nodes yet :)\r\n\r\nNodes get updated too often.\r\n\r\n> On Apr 17, 2015, at 3:08 PM, Luke Meyer <notifications@github.com> wrote:\r\n> \r\n> Just noting. If I do \"osc edit node/nodename\" I get an error which might possibly be related.\r\n> \r\n> # osc edit node/172.16.4.113\r\n> Error: minion \"172.16.4.113\" cannot be updated: the resource was updated to 2081\r\n> You must update your resource version and run `osc update -f /tmp/osc-edit-127098957` to overwrite the remote changes.\r\n> (I know the node resource version gets updated every few seconds but this still happens if I'm very quick with the edit or remove resourceVersion altogether)\r\n> \r\n> —\r\n> Reply to this email directly or view it on GitHub.\r\n> \r\n"}}