{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/22903247","id":22903247,"diff_hunk":"@@ -0,0 +1,100 @@\n+/*\n+Copyright 2014 Google Inc. 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 kubectl\n+\n+import (\n+\t\"strconv\"\n+\t\"strings\"\n+\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/api\"\n+\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime\"\n+\t\"github.com/golang/glog\"\n+)\n+\n+type BasicReplicationController struct{}\n+\n+func (BasicReplicationController) ParamNames() []GeneratorParam {\n+\treturn []GeneratorParam{\n+\t\t{\"labels\", false},\n+\t\t{\"name\", true},\n+\t\t{\"replicas\", true},\n+\t\t{\"image\", true},\n+\t\t{\"command\", false},\n+\t}\n+}\n+\n+func (BasicReplicationController) Generate(params map[string]string) (runtime.Object, error) {\n+\tlabelString, found := params[\"labels\"]\n+\tvar labels map[string]string\n+\tif found && len(labelString) > 0 {\n+\t\tlabels = ParseLabels(labelString)\n+\t} else {\n+\t\tlabels = map[string]string{\n+\t\t\t\"name\": params[\"name\"],","path":"pkg/kubectl/run.go","position":47,"original_position":47,"commit_id":"f5d81ae15d5c1dc3c2f1e08d2cb374b53d229118","original_commit_id":"42fe9053af698f1ca2db9015162f910001229a17","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},"body":"App :).  \r\n\r\n\r\n> On Jan 13, 2015, at 5:59 PM, bgrant0607 <notifications@github.com> wrote:\r\n> \r\n> In pkg/kubectl/run.go:\r\n> \r\n> > +\t\t{\"labels\", false},\r\n> > +\t\t{\"name\", true},\r\n> > +\t\t{\"replicas\", true},\r\n> > +\t\t{\"image\", true},\r\n> > +\t\t{\"command\", false},\r\n> > +\t}\r\n> > +}\r\n> > +\r\n> > +func (BasicReplicationController) Generate(params map[string]string) (runtime.Object, error) {\r\n> > +\tlabelString, found := params[\"labels\"]\r\n> > +\tvar labels map[string]string\r\n> > +\tif found && len(labelString) > 0 {\r\n> > +\t\tlabels = ParseLabels(labelString)\r\n> > +\t} else {\r\n> > +\t\tlabels = map[string]string{\r\n> > +\t\t\t\"name\": params[\"name\"],\r\n> My last comment here was not addressed in the last push. name generates confusion with respect to the metadata \"name\" field in the API. I'm flexible about what we replace it with: group, set, uservice, app, deployment, run-name, ...\r\n> \r\n> —\r\n> Reply to this email directly or view it on GitHub.\r\n> \r\n","created_at":"2015-01-13T23:00:38Z","updated_at":"2015-01-13T23:00:38Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3424#discussion_r22903247","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/22903247"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3424#discussion_r22903247"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424","id":27249901,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3424","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3424.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3424.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3424","number":3424,"state":"open","locked":false,"title":"Basic \"Run\" command","user":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},"body":"@bgrant0607 @smarterclayton @ghodss \r\n\r\nI tried to address the concerns in https://github.com/GoogleCloudPlatform/kubernetes/issues/1695.\r\n\r\nConcretely:\r\n   * Generator is a separate library\r\n   * I don't think generator versioning is necessary, we generate using internal representation, than convert to versioned output, so output is versioned, but generator is pegged to internal representation\r\n   * Creates a single replication controller, which is printed when things are done, I argue that object is easy to discover.\r\n   * There is a ```--preview``` flag that is suitable for \"just printing\" and all resource printers are supported.\r\n   * No special impertative commands, just generate, and then optionally send on wire, then print.\r\n   * Exposed some functionality, open to further suggestions.\r\n\r\nPlease let me know thoughts.  I'll add tests when folks agree this is a good starting place.\r\n\r\nThanks!\r\n--brendan\r\n","created_at":"2015-01-13T06:04:47Z","updated_at":"2015-01-13T23:00:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"391f0071429461ef8e3ea4c029b0cba43b44a3ae","assignee":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3424/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/f5d81ae15d5c1dc3c2f1e08d2cb374b53d229118","head":{"label":"brendandburns:run","ref":"run","sha":"f5d81ae15d5c1dc3c2f1e08d2cb374b53d229118","user":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},"repo":{"id":20748715,"name":"kubernetes","full_name":"brendandburns/kubernetes","owner":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brendandburns/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/brendandburns/kubernetes","forks_url":"https://api.github.com/repos/brendandburns/kubernetes/forks","keys_url":"https://api.github.com/repos/brendandburns/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brendandburns/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brendandburns/kubernetes/teams","hooks_url":"https://api.github.com/repos/brendandburns/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/brendandburns/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/brendandburns/kubernetes/events","assignees_url":"https://api.github.com/repos/brendandburns/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/brendandburns/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/brendandburns/kubernetes/tags","blobs_url":"https://api.github.com/repos/brendandburns/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brendandburns/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brendandburns/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/brendandburns/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brendandburns/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/brendandburns/kubernetes/languages","stargazers_url":"https://api.github.com/repos/brendandburns/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/brendandburns/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/brendandburns/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/brendandburns/kubernetes/subscription","commits_url":"https://api.github.com/repos/brendandburns/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/brendandburns/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/brendandburns/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/brendandburns/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/brendandburns/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/brendandburns/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brendandburns/kubernetes/merges","archive_url":"https://api.github.com/repos/brendandburns/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brendandburns/kubernetes/downloads","issues_url":"https://api.github.com/repos/brendandburns/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/brendandburns/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/brendandburns/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/brendandburns/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brendandburns/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/brendandburns/kubernetes/releases{/id}","created_at":"2014-06-12T00:13:18Z","updated_at":"2015-01-09T23:56:30Z","pushed_at":"2015-01-13T22:48:58Z","git_url":"git://github.com/brendandburns/kubernetes.git","ssh_url":"git@github.com:brendandburns/kubernetes.git","clone_url":"https://github.com/brendandburns/kubernetes.git","svn_url":"https://github.com/brendandburns/kubernetes","homepage":null,"size":26710,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"f589ee98e05345a0e6ecdd85d495df0ca48ed56a","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-01-13T22:43:59Z","pushed_at":"2015-01-13T22:43:59Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":null,"size":53337,"stargazers_count":5740,"watchers_count":5740,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":917,"mirror_url":null,"open_issues_count":551,"forks":917,"open_issues":551,"watchers":5740,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3424"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3424"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3424/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3424/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/f5d81ae15d5c1dc3c2f1e08d2cb374b53d229118"}}}}