mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Wait for controllerrevision informer to sync on statefulset controller startup
This commit is contained in:
parent
6b1b6d504a
commit
ba6ed642a1
@ -71,6 +71,8 @@ type StatefulSetController struct {
|
|||||||
setListerSynced cache.InformerSynced
|
setListerSynced cache.InformerSynced
|
||||||
// pvcListerSynced returns true if the pvc shared informer has synced at least once
|
// pvcListerSynced returns true if the pvc shared informer has synced at least once
|
||||||
pvcListerSynced cache.InformerSynced
|
pvcListerSynced cache.InformerSynced
|
||||||
|
// revListerSynced returns true if the rev shared informer has synced at least once
|
||||||
|
revListerSynced cache.InformerSynced
|
||||||
// StatefulSets that need to be synced.
|
// StatefulSets that need to be synced.
|
||||||
queue workqueue.RateLimitingInterface
|
queue workqueue.RateLimitingInterface
|
||||||
}
|
}
|
||||||
@ -103,6 +105,8 @@ func NewStatefulSetController(
|
|||||||
pvcListerSynced: pvcInformer.Informer().HasSynced,
|
pvcListerSynced: pvcInformer.Informer().HasSynced,
|
||||||
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "statefulset"),
|
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "statefulset"),
|
||||||
podControl: controller.RealPodControl{KubeClient: kubeClient, Recorder: recorder},
|
podControl: controller.RealPodControl{KubeClient: kubeClient, Recorder: recorder},
|
||||||
|
|
||||||
|
revListerSynced: revInformer.Informer().HasSynced,
|
||||||
}
|
}
|
||||||
|
|
||||||
podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
||||||
@ -146,7 +150,7 @@ func (ssc *StatefulSetController) Run(workers int, stopCh <-chan struct{}) {
|
|||||||
glog.Infof("Starting stateful set controller")
|
glog.Infof("Starting stateful set controller")
|
||||||
defer glog.Infof("Shutting down statefulset controller")
|
defer glog.Infof("Shutting down statefulset controller")
|
||||||
|
|
||||||
if !controller.WaitForCacheSync("stateful set", stopCh, ssc.podListerSynced, ssc.setListerSynced, ssc.pvcListerSynced) {
|
if !controller.WaitForCacheSync("stateful set", stopCh, ssc.podListerSynced, ssc.setListerSynced, ssc.pvcListerSynced, ssc.revListerSynced) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user