{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/53079235","id":53079235,"diff_hunk":"@@ -354,6 +354,19 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {\n \t\t\t\t\treturn nil, errors.New(\"provided options object is not a PodLogOptions\")\n \t\t\t\t}\n \t\t\t\treturn c.Pods(t.Namespace).GetLogs(t.Name, opts), nil\n+\n+\t\t\tcase *api.ReplicationController:\n+\t\t\t\topts, ok := options.(*api.PodLogOptions)\n+\t\t\t\tif !ok {\n+\t\t\t\t\treturn nil, errors.New(\"provided options object is not a PodLogOptions\")\n+\t\t\t\t}\n+\t\t\t\tselector := labels.SelectorFromSet(t.Spec.Selector)\n+\t\t\t\tpod, err := GetFirstPod(c, t.Namespace, selector)","path":"pkg/kubectl/cmd/util/factory.go","position":11,"original_position":11,"commit_id":"ad98f2de087e39d03c2d235a01f81b4506af33b5","original_commit_id":"ad98f2de087e39d03c2d235a01f81b4506af33b5","user":{"login":"jlowdermilk","id":2101035,"avatar_url":"https://avatars.githubusercontent.com/u/2101035?v=3","gravatar_id":"","url":"https://api.github.com/users/jlowdermilk","html_url":"https://github.com/jlowdermilk","followers_url":"https://api.github.com/users/jlowdermilk/followers","following_url":"https://api.github.com/users/jlowdermilk/following{/other_user}","gists_url":"https://api.github.com/users/jlowdermilk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlowdermilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlowdermilk/subscriptions","organizations_url":"https://api.github.com/users/jlowdermilk/orgs","repos_url":"https://api.github.com/users/jlowdermilk/repos","events_url":"https://api.github.com/users/jlowdermilk/events{/privacy}","received_events_url":"https://api.github.com/users/jlowdermilk/received_events","type":"User","site_admin":false},"body":"I think this should return an error if the rc has more than 1 pod. I don't know that there are any guarantees about ordering when listing pods with a selector; if there aren't any, rerunning the same command on a multi-pod rc might pick a different \"first pod\".","created_at":"2016-02-16T21:13:16Z","updated_at":"2016-02-16T21:13:16Z","html_url":"https://github.com/kubernetes/kubernetes/pull/21335#discussion_r53079235","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/53079235"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/21335#discussion_r53079235"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335","id":59549885,"html_url":"https://github.com/kubernetes/kubernetes/pull/21335","diff_url":"https://github.com/kubernetes/kubernetes/pull/21335.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/21335.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21335","number":21335,"state":"open","locked":false,"title":"make kubectl logs work for replication controllers","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"body":"Adds the ability to do `kubectl logs rc/foo` and get back the logs for the first pod.\r\n\r\n@kubernetes/kubectl \r\n@smarterclayton per request","created_at":"2016-02-16T20:33:46Z","updated_at":"2016-02-16T21:13:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98646cac7f36c7bc996048c4452f7c86a1f08a28","assignee":{"login":"jlowdermilk","id":2101035,"avatar_url":"https://avatars.githubusercontent.com/u/2101035?v=3","gravatar_id":"","url":"https://api.github.com/users/jlowdermilk","html_url":"https://github.com/jlowdermilk","followers_url":"https://api.github.com/users/jlowdermilk/followers","following_url":"https://api.github.com/users/jlowdermilk/following{/other_user}","gists_url":"https://api.github.com/users/jlowdermilk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlowdermilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlowdermilk/subscriptions","organizations_url":"https://api.github.com/users/jlowdermilk/orgs","repos_url":"https://api.github.com/users/jlowdermilk/repos","events_url":"https://api.github.com/users/jlowdermilk/events{/privacy}","received_events_url":"https://api.github.com/users/jlowdermilk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21335/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/ad98f2de087e39d03c2d235a01f81b4506af33b5","head":{"label":"deads2k:make-rc-logs-work","ref":"make-rc-logs-work","sha":"ad98f2de087e39d03c2d235a01f81b4506af33b5","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"repo":{"id":24939417,"name":"kubernetes","full_name":"deads2k/kubernetes","owner":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deads2k/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/deads2k/kubernetes","forks_url":"https://api.github.com/repos/deads2k/kubernetes/forks","keys_url":"https://api.github.com/repos/deads2k/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deads2k/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deads2k/kubernetes/teams","hooks_url":"https://api.github.com/repos/deads2k/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/deads2k/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/deads2k/kubernetes/events","assignees_url":"https://api.github.com/repos/deads2k/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/deads2k/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/deads2k/kubernetes/tags","blobs_url":"https://api.github.com/repos/deads2k/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deads2k/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deads2k/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/deads2k/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deads2k/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/deads2k/kubernetes/languages","stargazers_url":"https://api.github.com/repos/deads2k/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/deads2k/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/deads2k/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/deads2k/kubernetes/subscription","commits_url":"https://api.github.com/repos/deads2k/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/deads2k/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/deads2k/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/deads2k/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/deads2k/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/deads2k/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deads2k/kubernetes/merges","archive_url":"https://api.github.com/repos/deads2k/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deads2k/kubernetes/downloads","issues_url":"https://api.github.com/repos/deads2k/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/deads2k/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/deads2k/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/deads2k/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deads2k/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/deads2k/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/deads2k/kubernetes/deployments","created_at":"2014-10-08T12:24:01Z","updated_at":"2016-01-11T16:12:51Z","pushed_at":"2016-02-16T20:33:04Z","git_url":"git://github.com/deads2k/kubernetes.git","ssh_url":"git@github.com:deads2k/kubernetes.git","clone_url":"https://github.com/deads2k/kubernetes.git","svn_url":"https://github.com/deads2k/kubernetes","homepage":null,"size":165675,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"d00c650b28843b1edf910c28bd3ec92f5b32f662","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-02-16T20:22:04Z","pushed_at":"2016-02-16T21:07:33Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":327528,"stargazers_count":12717,"watchers_count":12717,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3624,"mirror_url":null,"open_issues_count":2850,"forks":3624,"open_issues":2850,"watchers":12717,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/21335"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/21335"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/21335/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/21335/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/ad98f2de087e39d03c2d235a01f81b4506af33b5"}}}}