Merge pull request #32081 from wojtek-t/list_from_apiserver_in_nodecontroller
Automatic merge from submit-queue NodeController listing nodes from apiserver cache Ref #31981 This is addressing this particular failure: https://github.com/kubernetes/kubernetes/issues/31981#issuecomment-244432054
This commit is contained in:
		@@ -486,7 +486,10 @@ func (nc *NodeController) Run() {
 | 
				
			|||||||
// post "NodeReady==ConditionUnknown". It also evicts all pods if node is not ready or
 | 
					// post "NodeReady==ConditionUnknown". It also evicts all pods if node is not ready or
 | 
				
			||||||
// not reachable for a long period of time.
 | 
					// not reachable for a long period of time.
 | 
				
			||||||
func (nc *NodeController) monitorNodeStatus() error {
 | 
					func (nc *NodeController) monitorNodeStatus() error {
 | 
				
			||||||
	nodes, err := nc.kubeClient.Core().Nodes().List(api.ListOptions{})
 | 
						// It is enough to list Nodes from apiserver, since we can tolerate some small
 | 
				
			||||||
 | 
						// delays comparing to state from etcd and there is eventual consistency anyway.
 | 
				
			||||||
 | 
						// TODO: We should list them from local cache: nodeStore.
 | 
				
			||||||
 | 
						nodes, err := nc.kubeClient.Core().Nodes().List(api.ListOptions{ResourceVersion: "0"})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user