Skip to content

Instantly share code, notes, and snippets.

@d-kuro
Last active March 7, 2019 19:01
Show Gist options
  • Save d-kuro/31b8776078f66f25011afe067f9c344e to your computer and use it in GitHub Desktop.
Save d-kuro/31b8776078f66f25011afe067f9c344e to your computer and use it in GitHub Desktop.
// from: https://github.com/kubernetes/kubernetes/blob/87f9429087d4e31201412548517d36e83abebc8d/pkg/controller/cronjob/cronjob_controller.go#L89-L97
// Run the main goroutine responsible for watching and syncing jobs.
func (jm *CronJobController) Run(stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
klog.Infof("Starting CronJob Manager")
// Check things every 10 second.
go wait.Until(jm.syncAll, 10*time.Second, stopCh)
<-stopCh
klog.Infof("Shutting down CronJob Manager")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment