{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/32157144","id":32157144,"diff_hunk":"@@ -0,0 +1,588 @@\n+/*\n+Copyright 2014 The Kubernetes Authors All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package cmd\n+\n+import (\n+\t\"encoding/json\"\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\t\"strings\"\n+\n+\t\"github.com/spf13/cobra\"\n+\n+\tkapi \"github.com/GoogleCloudPlatform/kubernetes/pkg/api\"\n+\tkapierrors \"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors\"\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/api/meta\"\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl\"\n+\tkcmdutil \"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/util\"\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/resource\"\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/labels\"\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime\"\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/util\"\n+\tkerrors \"github.com/GoogleCloudPlatform/kubernetes/pkg/util/errors\"\n+\n+\t\"github.com/openshift/origin/pkg/cmd/util/clientcmd\"\n+)\n+\n+const (\n+\tvolumeLong = `Update volumes on a pod\n+\n+This command can add, update, list or remove volumes from containers in pods or\n+any object that has a pod template (replication controllers or deployment configurations).\n+You can specify a single object or multiple, and alter volumes on all containers or\n+just those that match a wildcard.`\n+\n+\tvolumeExample = `  // Add new volume of type 'emptyDir' for deployment 'registry' and mount under /opt inside the containers\n+  $ %[1]s volume dc/registry --add --mount-path=/opt\n+  Here name of the volume is auto generated and default type 'emptyDir' will be used.\n+\n+  // Add new volume 'v1' with secret 'magic' for pod 'p1'\n+  $ %[1]s volume pod/p1 --add --name=v1 -m /etc --type=secret --secret-name=magic\n+\n+  // Add new volume to pod 'p1' based on gitRepo (or other volume sources not supported by --type)\n+  $ %[1]s volume pod/p1 --add -m /repo --source=<json-string>\n+\n+  // Change rc 'r1' to use persistent volume instead of emptyDir (vol name: v1)\n+  $ %[1]s volume rc/r1 --add --name=v1 -t persistentVolumeClaim --claim-name=pvc1 --confirm","path":"pkg/cmd/cli/cmd/volume.go","position":46,"original_position":62,"commit_id":"aa6086993734a554ce9c44b224df210522e1acdf","original_commit_id":"712eeba2ae7a22f18e3141d95ee75b0dcc89b1e9","user":{"login":"ncdc","id":354,"avatar_url":"https://avatars.githubusercontent.com/u/354?v=3","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},"body":"But you're not adding. You're removing and then re-adding. The English speaker in me thinks add/update or set are more appropriate, but I won't hold this up if everyone else is fine with add+confirm=rip+replace.","created_at":"2015-06-10T19:36:04Z","updated_at":"2015-06-10T19:36:04Z","html_url":"https://github.com/openshift/origin/pull/3023#discussion_r32157144","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/3023","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/32157144"},"html":{"href":"https://github.com/openshift/origin/pull/3023#discussion_r32157144"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/3023"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/3023","id":37299401,"html_url":"https://github.com/openshift/origin/pull/3023","diff_url":"https://github.com/openshift/origin/pull/3023.diff","patch_url":"https://github.com/openshift/origin/pull/3023.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/3023","number":3023,"state":"open","locked":false,"title":"OpenShift CLI cmd for volumes","user":{"login":"pravisankar","id":1258630,"avatar_url":"https://avatars.githubusercontent.com/u/1258630?v=3","gravatar_id":"","url":"https://api.github.com/users/pravisankar","html_url":"https://github.com/pravisankar","followers_url":"https://api.github.com/users/pravisankar/followers","following_url":"https://api.github.com/users/pravisankar/following{/other_user}","gists_url":"https://api.github.com/users/pravisankar/gists{/gist_id}","starred_url":"https://api.github.com/users/pravisankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravisankar/subscriptions","organizations_url":"https://api.github.com/users/pravisankar/orgs","repos_url":"https://api.github.com/users/pravisankar/repos","events_url":"https://api.github.com/users/pravisankar/events{/privacy}","received_events_url":"https://api.github.com/users/pravisankar/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-09T21:01:44Z","updated_at":"2015-06-10T19:36:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"575c53c273c04974f0ebe51b0e12d367680b6015","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/3023/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/3023/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/3023/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/aa6086993734a554ce9c44b224df210522e1acdf","head":{"label":"pravisankar:osc-volume","ref":"osc-volume","sha":"aa6086993734a554ce9c44b224df210522e1acdf","user":{"login":"pravisankar","id":1258630,"avatar_url":"https://avatars.githubusercontent.com/u/1258630?v=3","gravatar_id":"","url":"https://api.github.com/users/pravisankar","html_url":"https://github.com/pravisankar","followers_url":"https://api.github.com/users/pravisankar/followers","following_url":"https://api.github.com/users/pravisankar/following{/other_user}","gists_url":"https://api.github.com/users/pravisankar/gists{/gist_id}","starred_url":"https://api.github.com/users/pravisankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravisankar/subscriptions","organizations_url":"https://api.github.com/users/pravisankar/orgs","repos_url":"https://api.github.com/users/pravisankar/repos","events_url":"https://api.github.com/users/pravisankar/events{/privacy}","received_events_url":"https://api.github.com/users/pravisankar/received_events","type":"User","site_admin":false},"repo":{"id":26983891,"name":"origin","full_name":"pravisankar/origin","owner":{"login":"pravisankar","id":1258630,"avatar_url":"https://avatars.githubusercontent.com/u/1258630?v=3","gravatar_id":"","url":"https://api.github.com/users/pravisankar","html_url":"https://github.com/pravisankar","followers_url":"https://api.github.com/users/pravisankar/followers","following_url":"https://api.github.com/users/pravisankar/following{/other_user}","gists_url":"https://api.github.com/users/pravisankar/gists{/gist_id}","starred_url":"https://api.github.com/users/pravisankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravisankar/subscriptions","organizations_url":"https://api.github.com/users/pravisankar/orgs","repos_url":"https://api.github.com/users/pravisankar/repos","events_url":"https://api.github.com/users/pravisankar/events{/privacy}","received_events_url":"https://api.github.com/users/pravisankar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pravisankar/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/pravisankar/origin","forks_url":"https://api.github.com/repos/pravisankar/origin/forks","keys_url":"https://api.github.com/repos/pravisankar/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pravisankar/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pravisankar/origin/teams","hooks_url":"https://api.github.com/repos/pravisankar/origin/hooks","issue_events_url":"https://api.github.com/repos/pravisankar/origin/issues/events{/number}","events_url":"https://api.github.com/repos/pravisankar/origin/events","assignees_url":"https://api.github.com/repos/pravisankar/origin/assignees{/user}","branches_url":"https://api.github.com/repos/pravisankar/origin/branches{/branch}","tags_url":"https://api.github.com/repos/pravisankar/origin/tags","blobs_url":"https://api.github.com/repos/pravisankar/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pravisankar/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pravisankar/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/pravisankar/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pravisankar/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/pravisankar/origin/languages","stargazers_url":"https://api.github.com/repos/pravisankar/origin/stargazers","contributors_url":"https://api.github.com/repos/pravisankar/origin/contributors","subscribers_url":"https://api.github.com/repos/pravisankar/origin/subscribers","subscription_url":"https://api.github.com/repos/pravisankar/origin/subscription","commits_url":"https://api.github.com/repos/pravisankar/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/pravisankar/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/pravisankar/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/pravisankar/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/pravisankar/origin/contents/{+path}","compare_url":"https://api.github.com/repos/pravisankar/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pravisankar/origin/merges","archive_url":"https://api.github.com/repos/pravisankar/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pravisankar/origin/downloads","issues_url":"https://api.github.com/repos/pravisankar/origin/issues{/number}","pulls_url":"https://api.github.com/repos/pravisankar/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/pravisankar/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/pravisankar/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pravisankar/origin/labels{/name}","releases_url":"https://api.github.com/repos/pravisankar/origin/releases{/id}","created_at":"2014-11-22T00:39:33Z","updated_at":"2015-05-07T19:59:40Z","pushed_at":"2015-06-10T18:24:44Z","git_url":"git://github.com/pravisankar/origin.git","ssh_url":"git@github.com:pravisankar/origin.git","clone_url":"https://github.com/pravisankar/origin.git","svn_url":"https://github.com/pravisankar/origin","homepage":"https://openshift.github.io","size":114191,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"a0b96495105d812458bc810ec2636809e5656701","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","created_at":"2014-07-30T20:04:05Z","updated_at":"2015-06-10T13:56:28Z","pushed_at":"2015-06-10T19:31:35Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":179230,"stargazers_count":468,"watchers_count":468,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":239,"mirror_url":null,"open_issues_count":289,"forks":239,"open_issues":289,"watchers":468,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/3023"},"html":{"href":"https://github.com/openshift/origin/pull/3023"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/3023"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/3023/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/3023/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/3023/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/aa6086993734a554ce9c44b224df210522e1acdf"}}}}