{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/205915305","pull_request_review_id":141287506,"id":205915305,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTkxNTMwNQ==","diff_hunk":"@@ -221,14 +227,24 @@ func (o *WaitOptions) RunWait() error {\n \t\t}\n \t\treturn err\n \t})\n+\n+\tif err != nil {","path":"pkg/kubectl/cmd/wait/wait.go","position":46,"original_position":46,"commit_id":"642bc7e088ed67aa139c27de6239fb46edbc04f3","original_commit_id":"642bc7e088ed67aa139c27de6239fb46edbc04f3","user":{"login":"neolit123","id":331852,"node_id":"MDQ6VXNlcjMzMTg1Mg==","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":"You can remove this check and just \"return err\" at the end of the function.","created_at":"2018-07-27T22:37:17Z","updated_at":"2018-07-27T22:39:07Z","html_url":"https://github.com/kubernetes/kubernetes/pull/66692#discussion_r205915305","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/205915305"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/66692#discussion_r205915305"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692","id":204287711,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0Mjg3NzEx","html_url":"https://github.com/kubernetes/kubernetes/pull/66692","diff_url":"https://github.com/kubernetes/kubernetes/pull/66692.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/66692.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66692","number":66692,"state":"open","locked":false,"title":"Makes kubectl wait exit with status 1 and print an error message, if there is no resources matching selectors","user":{"login":"m1kola","id":509198,"node_id":"MDQ6VXNlcjUwOTE5OA==","avatar_url":"https://avatars1.githubusercontent.com/u/509198?v=4","gravatar_id":"","url":"https://api.github.com/users/m1kola","html_url":"https://github.com/m1kola","followers_url":"https://api.github.com/users/m1kola/followers","following_url":"https://api.github.com/users/m1kola/following{/other_user}","gists_url":"https://api.github.com/users/m1kola/gists{/gist_id}","starred_url":"https://api.github.com/users/m1kola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1kola/subscriptions","organizations_url":"https://api.github.com/users/m1kola/orgs","repos_url":"https://api.github.com/users/m1kola/repos","events_url":"https://api.github.com/users/m1kola/events{/privacy}","received_events_url":"https://api.github.com/users/m1kola/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\n\r\nIt makes the `kubectl wait` command print an error message and exit with exit code 1, if there is no resource matching users's query. This can happen when user specifies selectors. Example:\r\n\r\n```\r\nkubectl wait deployment -l app=something-that-does-not-exist --for condition=available --timeout=5s\r\n```\r\n\r\n**Which issue(s) this PR fixes**:\r\nFixes #66456\r\n\r\n**Special notes for your reviewer**:\r\n\r\nThis is my first contribution into the project (except one line change in docs) and don't have much experience with Go. I learned a lot while working on this (about resource finders and the `Visitor` interface and it's implementations), but it is very likely that I'm doing something wrong :)\r\n\r\nI'm keen to continue contributing into the project (into the cli part for now), so I will really appreciate detailed feedback, if you have a chance to provide it (point me into a right direction and/or explain why it's not a good idea to do something in a certain way).\r\n\r\nThanks!\r\n\r\n**Release note**:\r\n```release-note\r\nkubectl: the wait command now prints an error message and exits with the code 1, if there is no resources matching selectors\r\n```\r\n","created_at":"2018-07-26T22:50:51Z","updated_at":"2018-07-27T22:39:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9b968bb1f8e4047073d4e14c9606beeea1395d1","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mengqiy","id":2589105,"node_id":"MDQ6VXNlcjI1ODkxMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/2589105?v=4","gravatar_id":"","url":"https://api.github.com/users/mengqiy","html_url":"https://github.com/mengqiy","followers_url":"https://api.github.com/users/mengqiy/followers","following_url":"https://api.github.com/users/mengqiy/following{/other_user}","gists_url":"https://api.github.com/users/mengqiy/gists{/gist_id}","starred_url":"https://api.github.com/users/mengqiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mengqiy/subscriptions","organizations_url":"https://api.github.com/users/mengqiy/orgs","repos_url":"https://api.github.com/users/mengqiy/repos","events_url":"https://api.github.com/users/mengqiy/events{/privacy}","received_events_url":"https://api.github.com/users/mengqiy/received_events","type":"User","site_admin":false},{"login":"eparis","id":8093535,"node_id":"MDQ6VXNlcjgwOTM1MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/8093535?v=4","gravatar_id":"","url":"https://api.github.com/users/eparis","html_url":"https://github.com/eparis","followers_url":"https://api.github.com/users/eparis/followers","following_url":"https://api.github.com/users/eparis/following{/other_user}","gists_url":"https://api.github.com/users/eparis/gists{/gist_id}","starred_url":"https://api.github.com/users/eparis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eparis/subscriptions","organizations_url":"https://api.github.com/users/eparis/orgs","repos_url":"https://api.github.com/users/eparis/repos","events_url":"https://api.github.com/users/eparis/events{/privacy}","received_events_url":"https://api.github.com/users/eparis/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":477397086,"node_id":"MDU6TGFiZWw0NzczOTcwODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":573014062,"node_id":"MDU6TGFiZWw1NzMwMTQwNjI=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/needs-ok-to-test","name":"needs-ok-to-test","color":"b60205","default":false},{"id":200149833,"node_id":"MDU6TGFiZWwyMDAxNDk4MzM=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note","name":"release-note","color":"c2e0c6","default":false},{"id":253450978,"node_id":"MDU6TGFiZWwyNTM0NTA5Nzg=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/L","name":"size/L","color":"ee9900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66692/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/642bc7e088ed67aa139c27de6239fb46edbc04f3","head":{"label":"m1kola:66456_waitcmd__error_for_selectors","ref":"66456_waitcmd__error_for_selectors","sha":"642bc7e088ed67aa139c27de6239fb46edbc04f3","user":{"login":"m1kola","id":509198,"node_id":"MDQ6VXNlcjUwOTE5OA==","avatar_url":"https://avatars1.githubusercontent.com/u/509198?v=4","gravatar_id":"","url":"https://api.github.com/users/m1kola","html_url":"https://github.com/m1kola","followers_url":"https://api.github.com/users/m1kola/followers","following_url":"https://api.github.com/users/m1kola/following{/other_user}","gists_url":"https://api.github.com/users/m1kola/gists{/gist_id}","starred_url":"https://api.github.com/users/m1kola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1kola/subscriptions","organizations_url":"https://api.github.com/users/m1kola/orgs","repos_url":"https://api.github.com/users/m1kola/repos","events_url":"https://api.github.com/users/m1kola/events{/privacy}","received_events_url":"https://api.github.com/users/m1kola/received_events","type":"User","site_admin":false},"repo":{"id":141751389,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE3NTEzODk=","name":"kubernetes","full_name":"m1kola/kubernetes","owner":{"login":"m1kola","id":509198,"node_id":"MDQ6VXNlcjUwOTE5OA==","avatar_url":"https://avatars1.githubusercontent.com/u/509198?v=4","gravatar_id":"","url":"https://api.github.com/users/m1kola","html_url":"https://github.com/m1kola","followers_url":"https://api.github.com/users/m1kola/followers","following_url":"https://api.github.com/users/m1kola/following{/other_user}","gists_url":"https://api.github.com/users/m1kola/gists{/gist_id}","starred_url":"https://api.github.com/users/m1kola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1kola/subscriptions","organizations_url":"https://api.github.com/users/m1kola/orgs","repos_url":"https://api.github.com/users/m1kola/repos","events_url":"https://api.github.com/users/m1kola/events{/privacy}","received_events_url":"https://api.github.com/users/m1kola/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/m1kola/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/m1kola/kubernetes","forks_url":"https://api.github.com/repos/m1kola/kubernetes/forks","keys_url":"https://api.github.com/repos/m1kola/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m1kola/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m1kola/kubernetes/teams","hooks_url":"https://api.github.com/repos/m1kola/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/m1kola/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/m1kola/kubernetes/events","assignees_url":"https://api.github.com/repos/m1kola/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/m1kola/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/m1kola/kubernetes/tags","blobs_url":"https://api.github.com/repos/m1kola/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m1kola/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m1kola/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/m1kola/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m1kola/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/m1kola/kubernetes/languages","stargazers_url":"https://api.github.com/repos/m1kola/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/m1kola/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/m1kola/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/m1kola/kubernetes/subscription","commits_url":"https://api.github.com/repos/m1kola/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/m1kola/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/m1kola/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/m1kola/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/m1kola/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/m1kola/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m1kola/kubernetes/merges","archive_url":"https://api.github.com/repos/m1kola/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m1kola/kubernetes/downloads","issues_url":"https://api.github.com/repos/m1kola/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/m1kola/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/m1kola/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/m1kola/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m1kola/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/m1kola/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/m1kola/kubernetes/deployments","created_at":"2018-07-20T19:43:13Z","updated_at":"2018-07-20T19:43:50Z","pushed_at":"2018-07-26T22:19:58Z","git_url":"git://github.com/m1kola/kubernetes.git","ssh_url":"git@github.com:m1kola/kubernetes.git","clone_url":"https://github.com/m1kola/kubernetes.git","svn_url":"https://github.com/m1kola/kubernetes","homepage":"http://kubernetes.io","size":576860,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"e36b013be60dbd5a9213acd3c542fac69dbdfd4c","user":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMDU4MDQ5OA==","name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","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-07-27T22:23:36Z","pushed_at":"2018-07-27T22:20:10Z","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":795001,"stargazers_count":39285,"watchers_count":39285,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13702,"mirror_url":null,"archived":false,"open_issues_count":3178,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":13702,"open_issues":3178,"watchers":39285,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/66692"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/66692"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/66692/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/66692/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/642bc7e088ed67aa139c27de6239fb46edbc04f3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"neolit123"}}