{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/22833309","id":22833309,"diff_hunk":"@@ -168,14 +169,41 @@ func (factory *ConfigFactory) createMinionLW() *cache.ListWatch {\n \t}\n }\n \n-// pollMinions lists all minions and returns an enumerator for cache.Poller.\n+// pollMinions lists all minions and filter out unhealthy ones, then returns\n+// an enumerator for cache.Poller.\n func (factory *ConfigFactory) pollMinions() (cache.Enumerator, error) {\n-\tlist := &api.NodeList{}\n-\terr := factory.Client.Get().Resource(\"minions\").Do().Into(list)\n+\tallNodes := &api.NodeList{}\n+\terr := factory.Client.Get().Resource(\"minions\").Do().Into(allNodes)\n \tif err != nil {\n \t\treturn nil, err\n \t}\n-\treturn &nodeEnumerator{list}, nil\n+\tnodes := &api.NodeList{\n+\t\tTypeMeta: allNodes.TypeMeta,\n+\t\tListMeta: allNodes.ListMeta,\n+\t}\n+\tfor _, node := range allNodes.Items {\n+\t\tif len(node.Status.Conditions) == 0 {\n+\t\t\t// If no condition is set, node health check is disabled (master flag\n+\t\t\t// healthCheckMinions is set to false), we add nodes unconditionally.\n+\t\t\tglog.Infof(\"No condition set for node %v\", node.Name)\n+\t\t\tnodes.Items = append(nodes.Items, node)\n+\t\t\tcontinue\n+\t\t}\n+\t\tfor _, condition := range node.Status.Conditions {\n+\t\t\t// TODO: Distinguish different conditions and implement better condition check.\n+\t\t\tswitch condition.Kind {\n+\t\t\tcase api.NodeReady:\n+\t\t\t\tif condition.Status == api.ConditionFull {\n+\t\t\t\t\tnodes.Items = append(nodes.Items, node)\n+\t\t\t\t} else {\n+\t\t\t\t\tglog.V(2).Infof(\"Ignore unhealthy node %v\", node.Name)\n+\t\t\t\t}\n+\t\t\tdefault:\n+\t\t\t\tglog.Errorf(\"Unknown condition kind %v for node %v\", condition.Kind, node.Name)","path":"plugin/pkg/scheduler/factory/factory.go","position":48,"original_position":48,"commit_id":"0dad123703a4fa3fffe8f97f759689348ca3ac89","original_commit_id":"0dad123703a4fa3fffe8f97f759689348ca3ac89","user":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"body":"I've added the NodeReachable condition back, so the default will be error case now.  Logging the error case is better IMO.","created_at":"2015-01-12T23:48:20Z","updated_at":"2015-01-12T23:48:20Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3389#discussion_r22833309","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/22833309"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3389#discussion_r22833309"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389","id":27158295,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3389","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3389.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3389.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3389","number":3389,"state":"open","locked":false,"title":"Filter out unhealthy node in scheduler","user":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"body":"scheduler needs to be aware of unhealthy node now\r\nFix #3386","created_at":"2015-01-11T03:34:16Z","updated_at":"2015-01-12T23:48:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7bcac23601e36ecb360a4aa5afc6aac2c75c62f7","assignee":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","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},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3389/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/0dad123703a4fa3fffe8f97f759689348ca3ac89","head":{"label":"ddysher:update-scheduler","ref":"update-scheduler","sha":"0dad123703a4fa3fffe8f97f759689348ca3ac89","user":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"repo":{"id":22863953,"name":"kubernetes","full_name":"ddysher/kubernetes","owner":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ddysher/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/ddysher/kubernetes","forks_url":"https://api.github.com/repos/ddysher/kubernetes/forks","keys_url":"https://api.github.com/repos/ddysher/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ddysher/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ddysher/kubernetes/teams","hooks_url":"https://api.github.com/repos/ddysher/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/ddysher/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/ddysher/kubernetes/events","assignees_url":"https://api.github.com/repos/ddysher/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/ddysher/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/ddysher/kubernetes/tags","blobs_url":"https://api.github.com/repos/ddysher/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ddysher/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ddysher/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ddysher/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ddysher/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/ddysher/kubernetes/languages","stargazers_url":"https://api.github.com/repos/ddysher/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/ddysher/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/ddysher/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/ddysher/kubernetes/subscription","commits_url":"https://api.github.com/repos/ddysher/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ddysher/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ddysher/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ddysher/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/ddysher/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/ddysher/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ddysher/kubernetes/merges","archive_url":"https://api.github.com/repos/ddysher/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ddysher/kubernetes/downloads","issues_url":"https://api.github.com/repos/ddysher/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/ddysher/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/ddysher/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/ddysher/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ddysher/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/ddysher/kubernetes/releases{/id}","created_at":"2014-08-12T03:48:56Z","updated_at":"2014-08-15T00:25:36Z","pushed_at":"2015-01-12T22:49:06Z","git_url":"git://github.com/ddysher/kubernetes.git","ssh_url":"git@github.com:ddysher/kubernetes.git","clone_url":"https://github.com/ddysher/kubernetes.git","svn_url":"https://github.com/ddysher/kubernetes","homepage":null,"size":23058,"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":"GoogleCloudPlatform:master","ref":"master","sha":"823ab24068f83ec72d1ca7addefa3e3490f58fbf","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-01-12T23:47:17Z","pushed_at":"2015-01-12T23:47:15Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":null,"size":53046,"stargazers_count":5726,"watchers_count":5726,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":913,"mirror_url":null,"open_issues_count":551,"forks":913,"open_issues":551,"watchers":5726,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/3389"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3389"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/3389/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/3389/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/0dad123703a4fa3fffe8f97f759689348ca3ac89"}}}}