Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "NodeController waits for informer sync before doing a… #34857

Merged
merged 1 commit into from Oct 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions pkg/controller/node/nodecontroller.go
Expand Up @@ -399,6 +399,10 @@ func (nc *NodeController) Run() {

// Incorporate the results of node status pushed from kubelet to master.
go wait.Until(func() {
if !nc.nodeController.HasSynced() || !nc.podController.HasSynced() || !nc.daemonSetController.HasSynced() {
glog.V(2).Infof("NodeController is waiting for informers to sync...")
return
}
if err := nc.monitorNodeStatus(); err != nil {
glog.Errorf("Error monitoring node status: %v", err)
}
Expand All @@ -417,6 +421,10 @@ func (nc *NodeController) Run() {
// c. If there are pods still terminating, wait for their estimated completion
// before retrying
go wait.Until(func() {
if !nc.nodeController.HasSynced() || !nc.podController.HasSynced() || !nc.daemonSetController.HasSynced() {
glog.V(2).Infof("NodeController is waiting for informers to sync...")
return
}
nc.evictorLock.Lock()
defer nc.evictorLock.Unlock()
for k := range nc.zonePodEvictor {
Expand Down Expand Up @@ -450,6 +458,10 @@ func (nc *NodeController) Run() {
// TODO: replace with a controller that ensures pods that are terminating complete
// in a particular time period
go wait.Until(func() {
if !nc.nodeController.HasSynced() || !nc.podController.HasSynced() || !nc.daemonSetController.HasSynced() {
glog.V(2).Infof("NodeController is waiting for informers to sync...")
return
}
nc.evictorLock.Lock()
defer nc.evictorLock.Unlock()
for k := range nc.zoneTerminationEvictor {
Expand Down Expand Up @@ -478,6 +490,10 @@ func (nc *NodeController) Run() {
}, nodeEvictionPeriod, wait.NeverStop)

go wait.Until(func() {
if !nc.nodeController.HasSynced() || !nc.podController.HasSynced() || !nc.daemonSetController.HasSynced() {
glog.V(2).Infof("NodeController is waiting for informers to sync...")
return
}
pods, err := nc.podStore.List(labels.Everything())
if err != nil {
utilruntime.HandleError(err)
Expand Down