{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/188267806","pull_request_review_id":120208731,"id":188267806,"diff_hunk":"@@ -174,3 +197,22 @@ func (c *CreateClusterRoleOptions) RunCreateRole() error {\n \n \treturn c.PrintObj(clusterRole)\n }\n+\n+func generateAggretaionRule(rules []string) (*rbacv1.AggregationRule, error) {\n+\tmatchLabels := map[string]string{}\n+\tfor _, rule := range rules {\n+\t\tparts := strings.Split(rule, \"=\")\n+\t\tif len(parts) != 2 {\n+\t\t\treturn nil, fmt.Errorf(\"wrong aggretation rule format.must be like xxx=yyy\")","path":"pkg/kubectl/cmd/create/create_clusterrole.go","position":86,"original_position":86,"commit_id":"816efd29df38534609d4648b6b7af59204a59c00","original_commit_id":"816efd29df38534609d4648b6b7af59204a59c00","user":{"login":"neolit123","id":331852,"avatar_url":"https://avatars3.githubusercontent.com/u/331852?v=4","gravatar_id":"","url":"https://api.github.com/users/neolit123","html_url":"https://github.com/neolit123","followers_url":"https://api.github.com/users/neolit123/followers","following_url":"https://api.github.com/users/neolit123/following{/other_user}","gists_url":"https://api.github.com/users/neolit123/gists{/gist_id}","starred_url":"https://api.github.com/users/neolit123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neolit123/subscriptions","organizations_url":"https://api.github.com/users/neolit123/orgs","repos_url":"https://api.github.com/users/neolit123/repos","events_url":"https://api.github.com/users/neolit123/events{/privacy}","received_events_url":"https://api.github.com/users/neolit123/received_events","type":"User","site_admin":false},"body":"typo, also i would change it to:\r\n`wrong aggregation rule format. It should be xxx=yyy\"","created_at":"2018-05-15T12:31:26Z","updated_at":"2018-05-15T12:35:58Z","html_url":"https://github.com/kubernetes/kubernetes/pull/63851#discussion_r188267806","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/188267806"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/63851#discussion_r188267806"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851","id":188059877,"html_url":"https://github.com/kubernetes/kubernetes/pull/63851","diff_url":"https://github.com/kubernetes/kubernetes/pull/63851.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/63851.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/63851","number":63851,"state":"open","locked":false,"title":"Make kubectl could create clusterrole with aggregation rules","user":{"login":"WanLinghao","id":13160186,"avatar_url":"https://avatars3.githubusercontent.com/u/13160186?v=4","gravatar_id":"","url":"https://api.github.com/users/WanLinghao","html_url":"https://github.com/WanLinghao","followers_url":"https://api.github.com/users/WanLinghao/followers","following_url":"https://api.github.com/users/WanLinghao/following{/other_user}","gists_url":"https://api.github.com/users/WanLinghao/gists{/gist_id}","starred_url":"https://api.github.com/users/WanLinghao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WanLinghao/subscriptions","organizations_url":"https://api.github.com/users/WanLinghao/orgs","repos_url":"https://api.github.com/users/WanLinghao/repos","events_url":"https://api.github.com/users/WanLinghao/events{/privacy}","received_events_url":"https://api.github.com/users/WanLinghao/received_events","type":"User","site_admin":false},"body":"\r\n\r\n<!--  Thanks for sending a pull request!  Here are some tips for you:\r\n1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/guide#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide\r\n2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews\r\n3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md\r\n4. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests\r\n-->\r\n\r\n**What this PR does / why we need it**:\r\nThe clusterrole aggregation rule features are available since v1.9:\r\nhttps://kubernetes.io/docs/admin/authorization/rbac/#aggregated-clusterroles\r\nThis patch makes kubectl could create clusterrole with aggregation rules.\r\n**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:\r\nFixes #\r\n\r\n**Special notes for your reviewer**:\r\n\r\n**Release note**:\r\n<!--  Write your release note:\r\n1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string \"action required\".\r\n2. If no release note is required, just write \"NONE\".\r\n-->\r\n```release-note\r\nNONE\r\n```\r\n","created_at":"2018-05-15T09:06:37Z","updated_at":"2018-05-15T12:35:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a51d355b4d95f700d126d7e94e2f5342cc3f08af","assignee":null,"assignees":[],"requested_reviewers":[{"login":"juanvallejo","id":3902875,"avatar_url":"https://avatars2.githubusercontent.com/u/3902875?v=4","gravatar_id":"","url":"https://api.github.com/users/juanvallejo","html_url":"https://github.com/juanvallejo","followers_url":"https://api.github.com/users/juanvallejo/followers","following_url":"https://api.github.com/users/juanvallejo/following{/other_user}","gists_url":"https://api.github.com/users/juanvallejo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanvallejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanvallejo/subscriptions","organizations_url":"https://api.github.com/users/juanvallejo/orgs","repos_url":"https://api.github.com/users/juanvallejo/repos","events_url":"https://api.github.com/users/juanvallejo/events{/privacy}","received_events_url":"https://api.github.com/users/juanvallejo/received_events","type":"User","site_admin":false},{"login":"derekwaynecarr","id":6233452,"avatar_url":"https://avatars3.githubusercontent.com/u/6233452?v=4","gravatar_id":"","url":"https://api.github.com/users/derekwaynecarr","html_url":"https://github.com/derekwaynecarr","followers_url":"https://api.github.com/users/derekwaynecarr/followers","following_url":"https://api.github.com/users/derekwaynecarr/following{/other_user}","gists_url":"https://api.github.com/users/derekwaynecarr/gists{/gist_id}","starred_url":"https://api.github.com/users/derekwaynecarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekwaynecarr/subscriptions","organizations_url":"https://api.github.com/users/derekwaynecarr/orgs","repos_url":"https://api.github.com/users/derekwaynecarr/repos","events_url":"https://api.github.com/users/derekwaynecarr/events{/privacy}","received_events_url":"https://api.github.com/users/derekwaynecarr/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":477397086,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":349530249,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6","default":false},{"id":253450934,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/M","name":"size/M","color":"eebb00","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/63851/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/816efd29df38534609d4648b6b7af59204a59c00","head":{"label":"WanLinghao:ctl_create_aggegated_rules","ref":"ctl_create_aggegated_rules","sha":"816efd29df38534609d4648b6b7af59204a59c00","user":{"login":"WanLinghao","id":13160186,"avatar_url":"https://avatars3.githubusercontent.com/u/13160186?v=4","gravatar_id":"","url":"https://api.github.com/users/WanLinghao","html_url":"https://github.com/WanLinghao","followers_url":"https://api.github.com/users/WanLinghao/followers","following_url":"https://api.github.com/users/WanLinghao/following{/other_user}","gists_url":"https://api.github.com/users/WanLinghao/gists{/gist_id}","starred_url":"https://api.github.com/users/WanLinghao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WanLinghao/subscriptions","organizations_url":"https://api.github.com/users/WanLinghao/orgs","repos_url":"https://api.github.com/users/WanLinghao/repos","events_url":"https://api.github.com/users/WanLinghao/events{/privacy}","received_events_url":"https://api.github.com/users/WanLinghao/received_events","type":"User","site_admin":false},"repo":{"id":98487864,"name":"kubernetes","full_name":"WanLinghao/kubernetes","owner":{"login":"WanLinghao","id":13160186,"avatar_url":"https://avatars3.githubusercontent.com/u/13160186?v=4","gravatar_id":"","url":"https://api.github.com/users/WanLinghao","html_url":"https://github.com/WanLinghao","followers_url":"https://api.github.com/users/WanLinghao/followers","following_url":"https://api.github.com/users/WanLinghao/following{/other_user}","gists_url":"https://api.github.com/users/WanLinghao/gists{/gist_id}","starred_url":"https://api.github.com/users/WanLinghao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WanLinghao/subscriptions","organizations_url":"https://api.github.com/users/WanLinghao/orgs","repos_url":"https://api.github.com/users/WanLinghao/repos","events_url":"https://api.github.com/users/WanLinghao/events{/privacy}","received_events_url":"https://api.github.com/users/WanLinghao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WanLinghao/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/WanLinghao/kubernetes","forks_url":"https://api.github.com/repos/WanLinghao/kubernetes/forks","keys_url":"https://api.github.com/repos/WanLinghao/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WanLinghao/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WanLinghao/kubernetes/teams","hooks_url":"https://api.github.com/repos/WanLinghao/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/WanLinghao/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/WanLinghao/kubernetes/events","assignees_url":"https://api.github.com/repos/WanLinghao/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/WanLinghao/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/WanLinghao/kubernetes/tags","blobs_url":"https://api.github.com/repos/WanLinghao/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WanLinghao/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WanLinghao/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/WanLinghao/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WanLinghao/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/WanLinghao/kubernetes/languages","stargazers_url":"https://api.github.com/repos/WanLinghao/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/WanLinghao/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/WanLinghao/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/WanLinghao/kubernetes/subscription","commits_url":"https://api.github.com/repos/WanLinghao/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/WanLinghao/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/WanLinghao/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/WanLinghao/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/WanLinghao/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/WanLinghao/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WanLinghao/kubernetes/merges","archive_url":"https://api.github.com/repos/WanLinghao/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WanLinghao/kubernetes/downloads","issues_url":"https://api.github.com/repos/WanLinghao/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/WanLinghao/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/WanLinghao/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/WanLinghao/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WanLinghao/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/WanLinghao/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/WanLinghao/kubernetes/deployments","created_at":"2017-07-27T03:02:23Z","updated_at":"2017-07-27T03:03:05Z","pushed_at":"2018-05-15T08:58:46Z","git_url":"git://github.com/WanLinghao/kubernetes.git","ssh_url":"git@github.com:WanLinghao/kubernetes.git","clone_url":"https://github.com/WanLinghao/kubernetes.git","svn_url":"https://github.com/WanLinghao/kubernetes","homepage":"http://kubernetes.io","size":549748,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"dc62a73742e42a77b01828103cde656e4a0d2d19","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","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://avatars2.githubusercontent.com/u/13629408?v=4","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":"Production-Grade Container Scheduling and Management","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":"2018-05-15T12:25:40Z","pushed_at":"2018-05-15T12:35:50Z","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":777419,"stargazers_count":36298,"watchers_count":36298,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12786,"mirror_url":null,"archived":false,"open_issues_count":3269,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":12786,"open_issues":3269,"watchers":36298,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/63851"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/63851"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/63851/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/63851/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/816efd29df38534609d4648b6b7af59204a59c00"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"neolit123"}}