fixes the way the informers are started in sample controller pkg

Kubernetes-commit: e55ca64dbd3b141f8a373d129b1a619db0e672f0
This commit is contained in:
p0lyn0mial 2018-10-10 20:54:36 +02:00 committed by Kubernetes Publisher
parent fe5d3e0825
commit 3cc2958b99

View File

@ -65,8 +65,10 @@ func main() {
kubeInformerFactory.Apps().V1().Deployments(),
exampleInformerFactory.Samplecontroller().V1alpha1().Foos())
go kubeInformerFactory.Start(stopCh)
go exampleInformerFactory.Start(stopCh)
// notice that there is no need to run Start methods in a separate goroutine. (i.e. go kubeInformerFactory.Start(stopCh)
// Start method is non-blocking and runs all registered informers in a dedicated goroutine.
kubeInformerFactory.Start(stopCh)
exampleInformerFactory.Start(stopCh)
if err = controller.Run(2, stopCh); err != nil {
glog.Fatalf("Error running controller: %s", err.Error())