in pkg/localcontroller/controller.go [83:98]
func (c *Controller) Run(workers int, stopCh <-chan struct{}) error {
defer utilruntime.HandleCrash()
defer c.workqueue.ShutDown()
if ok := cache.WaitForCacheSync(stopCh, c.nodesSynced); !ok {
return fmt.Errorf("failed to wait for caches to sync")
}
// Start n workers in parallel
for i := 0; i < workers; i++ {
go wait.Until(c.runWorker, 10*time.Second, stopCh)
}
<-stopCh
return nil
}