Merge pull request #42550 from shashidharatd/federation

Automatic merge from submit-queue

Fix federation controller-manager initialization

Due to #42375, the e2e tests for federation started failing. The cause is that servicecontroller.Run blocks on stopCh. In #42375, the code is reorganized and servicecontroller which was initialized last is moved to top, so all the controllers below it are not initialized.

This pr fixes the issue by calling stopCh of servicecontroller in a goroutine.

cc @kubernetes/sig-federation-bugs @nikhiljindal @madhusudancs
This commit is contained in:
Kubernetes Submit Queue 2017-03-06 03:20:14 -08:00 committed by GitHub
commit 6d92abdc0a

View File

@ -403,10 +403,12 @@ func (s *ServiceController) Run(workers int, stopCh <-chan struct{}) error {
go wait.Until(s.clusterEndpointWorker, time.Second, stopCh)
go wait.Until(s.clusterServiceWorker, time.Second, stopCh)
go wait.Until(s.clusterSyncLoop, time.Second, stopCh)
<-stopCh
glog.Infof("Shutting down Federation Service Controller")
s.queue.ShutDown()
s.federatedInformer.Stop()
go func() {
<-stopCh
glog.Infof("Shutting down Federation Service Controller")
s.queue.ShutDown()
s.federatedInformer.Stop()
}()
return nil
}