mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Make controller Run methods consistent
- startup/shutdown logging - wait for cache sync logging - defer utilruntime.HandleCrash() - wait for stop channel before exiting
This commit is contained in:
@@ -141,10 +141,10 @@ func (ssc *StatefulSetController) Run(workers int, stopCh <-chan struct{}) {
|
||||
defer utilruntime.HandleCrash()
|
||||
defer ssc.queue.ShutDown()
|
||||
|
||||
glog.Infof("Starting statefulset controller")
|
||||
glog.Infof("Starting stateful set controller")
|
||||
defer glog.Infof("Shutting down statefulset controller")
|
||||
|
||||
if !cache.WaitForCacheSync(stopCh, ssc.podListerSynced, ssc.setListerSynced, ssc.pvcListerSynced) {
|
||||
utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
|
||||
if !controller.WaitForCacheSync("stateful set", stopCh, ssc.podListerSynced, ssc.setListerSynced, ssc.pvcListerSynced) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -153,7 +153,6 @@ func (ssc *StatefulSetController) Run(workers int, stopCh <-chan struct{}) {
|
||||
}
|
||||
|
||||
<-stopCh
|
||||
glog.Infof("Shutting down statefulset controller")
|
||||
}
|
||||
|
||||
// addPod adds the statefulset for the pod to the sync queue
|
||||
|
||||
Reference in New Issue
Block a user