{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/73924236","id":73924236,"diff_hunk":"@@ -119,6 +119,11 @@ func (h *HeapsterMetricsClient) GetCpuConsumptionAndRequestInMillis(namespace st\n \tif err != nil {\n \t\treturn 0, 0, time.Time{}, fmt.Errorf(\"failed to get pod list: %v\", err)\n \t}\n+\n+\tif len(podList.Items) == 0 {\n+\t\treturn 0, 0, time.Time{}, fmt.Errorf(\"the pod list number is zero\")","path":"pkg/controller/podautoscaler/metrics/metrics_client.go","position":6,"original_position":6,"commit_id":"c642a0a762712d6d842e6bece1b1ee72dbf52d24","original_commit_id":"c642a0a762712d6d842e6bece1b1ee72dbf52d24","user":{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false},"body":"The error message is confusing. Please change to: `empty pod list for selector: %v`","created_at":"2016-08-08T18:09:09Z","updated_at":"2016-08-08T18:09:09Z","html_url":"https://github.com/kubernetes/kubernetes/pull/29530#discussion_r73924236","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/73924236"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/29530#discussion_r73924236"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530","id":78620264,"html_url":"https://github.com/kubernetes/kubernetes/pull/29530","diff_url":"https://github.com/kubernetes/kubernetes/pull/29530.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/29530.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/29530","number":29530,"state":"open","locked":false,"title":"check zero before using after getting podList.Items","user":{"login":"lixiaobing10051267","id":16774510,"avatar_url":"https://avatars.githubusercontent.com/u/16774510?v=3","gravatar_id":"","url":"https://api.github.com/users/lixiaobing10051267","html_url":"https://github.com/lixiaobing10051267","followers_url":"https://api.github.com/users/lixiaobing10051267/followers","following_url":"https://api.github.com/users/lixiaobing10051267/following{/other_user}","gists_url":"https://api.github.com/users/lixiaobing10051267/gists{/gist_id}","starred_url":"https://api.github.com/users/lixiaobing10051267/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lixiaobing10051267/subscriptions","organizations_url":"https://api.github.com/users/lixiaobing10051267/orgs","repos_url":"https://api.github.com/users/lixiaobing10051267/repos","events_url":"https://api.github.com/users/lixiaobing10051267/events{/privacy}","received_events_url":"https://api.github.com/users/lixiaobing10051267/received_events","type":"User","site_admin":false},"body":"It is better to check zero before using after getting podList.Items: line 116\r\n\r\n\tpodList, err := h.client.Core().Pods(namespace).\r\n\t\tList(api.ListOptions{LabelSelector: selector})\r\n","created_at":"2016-07-25T02:50:38Z","updated_at":"2016-08-08T18:09:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9db88d771d675810959d62699dd8c276d8a612e","assignee":{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false},"assignees":[{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/29530/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c642a0a762712d6d842e6bece1b1ee72dbf52d24","head":{"label":"lixiaobing10051267:masterZero","ref":"masterZero","sha":"c642a0a762712d6d842e6bece1b1ee72dbf52d24","user":{"login":"lixiaobing10051267","id":16774510,"avatar_url":"https://avatars.githubusercontent.com/u/16774510?v=3","gravatar_id":"","url":"https://api.github.com/users/lixiaobing10051267","html_url":"https://github.com/lixiaobing10051267","followers_url":"https://api.github.com/users/lixiaobing10051267/followers","following_url":"https://api.github.com/users/lixiaobing10051267/following{/other_user}","gists_url":"https://api.github.com/users/lixiaobing10051267/gists{/gist_id}","starred_url":"https://api.github.com/users/lixiaobing10051267/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lixiaobing10051267/subscriptions","organizations_url":"https://api.github.com/users/lixiaobing10051267/orgs","repos_url":"https://api.github.com/users/lixiaobing10051267/repos","events_url":"https://api.github.com/users/lixiaobing10051267/events{/privacy}","received_events_url":"https://api.github.com/users/lixiaobing10051267/received_events","type":"User","site_admin":false},"repo":{"id":62378520,"name":"kubernetes","full_name":"lixiaobing10051267/kubernetes","owner":{"login":"lixiaobing10051267","id":16774510,"avatar_url":"https://avatars.githubusercontent.com/u/16774510?v=3","gravatar_id":"","url":"https://api.github.com/users/lixiaobing10051267","html_url":"https://github.com/lixiaobing10051267","followers_url":"https://api.github.com/users/lixiaobing10051267/followers","following_url":"https://api.github.com/users/lixiaobing10051267/following{/other_user}","gists_url":"https://api.github.com/users/lixiaobing10051267/gists{/gist_id}","starred_url":"https://api.github.com/users/lixiaobing10051267/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lixiaobing10051267/subscriptions","organizations_url":"https://api.github.com/users/lixiaobing10051267/orgs","repos_url":"https://api.github.com/users/lixiaobing10051267/repos","events_url":"https://api.github.com/users/lixiaobing10051267/events{/privacy}","received_events_url":"https://api.github.com/users/lixiaobing10051267/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lixiaobing10051267/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/lixiaobing10051267/kubernetes","forks_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/forks","keys_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/teams","hooks_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/events","assignees_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/tags","blobs_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/languages","stargazers_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/subscription","commits_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/merges","archive_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/downloads","issues_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/lixiaobing10051267/kubernetes/deployments","created_at":"2016-07-01T08:42:18Z","updated_at":"2016-07-15T04:40:37Z","pushed_at":"2016-08-08T06:56:14Z","git_url":"git://github.com/lixiaobing10051267/kubernetes.git","ssh_url":"git@github.com:lixiaobing10051267/kubernetes.git","clone_url":"https://github.com/lixiaobing10051267/kubernetes.git","svn_url":"https://github.com/lixiaobing10051267/kubernetes","homepage":"http://kubernetes.io","size":301512,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"b7e879174625599c8c232f9d7e9bed9b7e7a9998","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":"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":"2016-08-08T17:12:46Z","pushed_at":"2016-08-08T18:01:52Z","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":515792,"stargazers_count":16025,"watchers_count":16025,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5072,"mirror_url":null,"open_issues_count":4097,"forks":5072,"open_issues":4097,"watchers":16025,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/29530"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/29530"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/29530/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29530/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c642a0a762712d6d842e6bece1b1ee72dbf52d24"}}}}
{"actor":{"display_login":"piosz"}}