{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/172480663","pull_request_review_id":101500740,"id":172480663,"diff_hunk":"@@ -134,3 +134,44 @@ func TestKindForGroupVersionKinds(t *testing.T) {\n \t\t}\n \t}\n }\n+\n+func TestParseKindArg(t *testing.T) {\n+\ttests := []struct {\n+\t\tinput string\n+\t\tgvk   *GroupVersionKind\n+\t\tgk    GroupKind\n+\t}{\n+\t\t{input: \"v1\", gk: GroupKind{Kind: \"v1\"}},\n+\t\t{input: \".v1\", gk: GroupKind{Group: \"v1\"}},\n+\t\t{input: \"v1.\", gk: GroupKind{Kind: \"v1\"}},\n+\t\t{input: \"v1.a\", gk: GroupKind{Group: \"a\", Kind: \"v1\"}},\n+\t\t{input: \"b.v1.a\", gvk: &GroupVersionKind{Group: \"a\", Version: \"v1\", Kind: \"b\"}, gk: GroupKind{Group: \"v1.a\", Kind: \"b\"}},\n+\t}\n+\tfor i, test := range tests {\n+\t\tgvk, gk := ParseKindArg(test.input)\n+\t\tif (gvk != nil && test.gvk == nil) || (gvk == nil && test.gvk != nil) || (test.gvk != nil && *gvk != *test.gvk) {\n+\t\t\tt.Errorf(\"%d: expected output: %#v, got: %#v\", i, test.gvk, gvk)\n+\t\t}\n+\t\tif gk != test.gk {\n+\t\t\tt.Errorf(\"%d: expected output: %#v, got: %#v\", i, test.gk, gk)\n+\t\t}\n+\t}\n+}\n+\n+func TestParseGroupKind(t *testing.T) {\n+\ttests := []struct {\n+\t\tinput string\n+\t\tout   GroupKind\n+\t}{\n+\t\t{input: \"v1\", out: GroupKind{Kind: \"v1\"}},\n+\t\t{input: \".v1\", out: GroupKind{Group: \"v1\"}},\n+\t\t{input: \"a.v1\", out: GroupKind{Group: \"v1\", Kind: \"a\"}},\n+\t\t{input: \"a.v1.b\", out: GroupKind{Group: \"b\", Kind: \"a.v1\"}},","path":"staging/src/k8s.io/apimachinery/pkg/runtime/schema/group_version_test.go","position":36,"original_position":36,"commit_id":"056466b61914a32a13b2e360f8877b1ba7418671","original_commit_id":"056466b61914a32a13b2e360f8877b1ba7418671","user":{"login":"hzxuzhonghu","id":13374016,"avatar_url":"https://avatars3.githubusercontent.com/u/13374016?v=4","gravatar_id":"","url":"https://api.github.com/users/hzxuzhonghu","html_url":"https://github.com/hzxuzhonghu","followers_url":"https://api.github.com/users/hzxuzhonghu/followers","following_url":"https://api.github.com/users/hzxuzhonghu/following{/other_user}","gists_url":"https://api.github.com/users/hzxuzhonghu/gists{/gist_id}","starred_url":"https://api.github.com/users/hzxuzhonghu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzxuzhonghu/subscriptions","organizations_url":"https://api.github.com/users/hzxuzhonghu/orgs","repos_url":"https://api.github.com/users/hzxuzhonghu/repos","events_url":"https://api.github.com/users/hzxuzhonghu/events{/privacy}","received_events_url":"https://api.github.com/users/hzxuzhonghu/received_events","type":"User","site_admin":false},"body":"no such case","created_at":"2018-03-06T11:00:59Z","updated_at":"2018-03-06T11:00:59Z","html_url":"https://github.com/kubernetes/kubernetes/pull/60836#discussion_r172480663","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/60836","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/172480663"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/60836#discussion_r172480663"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/60836"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/60836","id":173103650,"html_url":"https://github.com/kubernetes/kubernetes/pull/60836","diff_url":"https://github.com/kubernetes/kubernetes/pull/60836.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/60836.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60836","number":60836,"state":"open","locked":false,"title":"add unit test for function ParseKindArg and ParseGroupKind","user":{"login":"hanxiaoshuai","id":30897305,"avatar_url":"https://avatars3.githubusercontent.com/u/30897305?v=4","gravatar_id":"","url":"https://api.github.com/users/hanxiaoshuai","html_url":"https://github.com/hanxiaoshuai","followers_url":"https://api.github.com/users/hanxiaoshuai/followers","following_url":"https://api.github.com/users/hanxiaoshuai/following{/other_user}","gists_url":"https://api.github.com/users/hanxiaoshuai/gists{/gist_id}","starred_url":"https://api.github.com/users/hanxiaoshuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanxiaoshuai/subscriptions","organizations_url":"https://api.github.com/users/hanxiaoshuai/orgs","repos_url":"https://api.github.com/users/hanxiaoshuai/repos","events_url":"https://api.github.com/users/hanxiaoshuai/events{/privacy}","received_events_url":"https://api.github.com/users/hanxiaoshuai/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\nadd unit test for function ParseKindArg and ParseGroupKind\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-03-06T09:40:21Z","updated_at":"2018-03-06T11:00:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5bab314c7424ad37004165c256139030c3fe9fc","assignee":null,"assignees":[],"requested_reviewers":[{"login":"lavalamp","id":647318,"avatar_url":"https://avatars0.githubusercontent.com/u/647318?v=4","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},{"login":"thockin","id":5595220,"avatar_url":"https://avatars0.githubusercontent.com/u/5595220?v=4","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/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/60836/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/60836/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60836/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/056466b61914a32a13b2e360f8877b1ba7418671","head":{"label":"hanxiaoshuai:addut03061","ref":"addut03061","sha":"056466b61914a32a13b2e360f8877b1ba7418671","user":{"login":"hanxiaoshuai","id":30897305,"avatar_url":"https://avatars3.githubusercontent.com/u/30897305?v=4","gravatar_id":"","url":"https://api.github.com/users/hanxiaoshuai","html_url":"https://github.com/hanxiaoshuai","followers_url":"https://api.github.com/users/hanxiaoshuai/followers","following_url":"https://api.github.com/users/hanxiaoshuai/following{/other_user}","gists_url":"https://api.github.com/users/hanxiaoshuai/gists{/gist_id}","starred_url":"https://api.github.com/users/hanxiaoshuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanxiaoshuai/subscriptions","organizations_url":"https://api.github.com/users/hanxiaoshuai/orgs","repos_url":"https://api.github.com/users/hanxiaoshuai/repos","events_url":"https://api.github.com/users/hanxiaoshuai/events{/privacy}","received_events_url":"https://api.github.com/users/hanxiaoshuai/received_events","type":"User","site_admin":false},"repo":{"id":99979894,"name":"kubernetes","full_name":"hanxiaoshuai/kubernetes","owner":{"login":"hanxiaoshuai","id":30897305,"avatar_url":"https://avatars3.githubusercontent.com/u/30897305?v=4","gravatar_id":"","url":"https://api.github.com/users/hanxiaoshuai","html_url":"https://github.com/hanxiaoshuai","followers_url":"https://api.github.com/users/hanxiaoshuai/followers","following_url":"https://api.github.com/users/hanxiaoshuai/following{/other_user}","gists_url":"https://api.github.com/users/hanxiaoshuai/gists{/gist_id}","starred_url":"https://api.github.com/users/hanxiaoshuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanxiaoshuai/subscriptions","organizations_url":"https://api.github.com/users/hanxiaoshuai/orgs","repos_url":"https://api.github.com/users/hanxiaoshuai/repos","events_url":"https://api.github.com/users/hanxiaoshuai/events{/privacy}","received_events_url":"https://api.github.com/users/hanxiaoshuai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hanxiaoshuai/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/hanxiaoshuai/kubernetes","forks_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/forks","keys_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/teams","hooks_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/events","assignees_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/tags","blobs_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/languages","stargazers_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/subscription","commits_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/merges","archive_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/downloads","issues_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/hanxiaoshuai/kubernetes/deployments","created_at":"2017-08-11T01:40:20Z","updated_at":"2017-08-11T01:41:01Z","pushed_at":"2018-03-06T09:38:04Z","git_url":"git://github.com/hanxiaoshuai/kubernetes.git","ssh_url":"git@github.com:hanxiaoshuai/kubernetes.git","clone_url":"https://github.com/hanxiaoshuai/kubernetes.git","svn_url":"https://github.com/hanxiaoshuai/kubernetes","homepage":"http://kubernetes.io","size":542337,"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":"04634cb19843195a43d13975d2a13d721512bb1d","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-03-06T10:57:59Z","pushed_at":"2018-03-06T10:49:13Z","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":762876,"stargazers_count":33354,"watchers_count":33354,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11823,"mirror_url":null,"archived":false,"open_issues_count":3773,"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":11823,"open_issues":3773,"watchers":33354,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/60836"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/60836"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/60836"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/60836/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/60836/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/60836/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/056466b61914a32a13b2e360f8877b1ba7418671"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hzxuzhonghu"}}