mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +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
|
||||
// pvcListerSynced returns true if the pvc shared informer has synced at least once
|
||||
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.
|
||||
queue workqueue.RateLimitingInterface
|
||||
}
|
||||
@ -103,6 +105,8 @@ func NewStatefulSetController(
|
||||
pvcListerSynced: pvcInformer.Informer().HasSynced,
|
||||
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "statefulset"),
|
||||
podControl: controller.RealPodControl{KubeClient: kubeClient, Recorder: recorder},
|
||||
|
||||
revListerSynced: revInformer.Informer().HasSynced,
|
||||
}
|
||||
|
||||
podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
||||
@ -146,7 +150,7 @@ func (ssc *StatefulSetController) Run(workers int, stopCh <-chan struct{}) {
|
||||
glog.Infof("Starting stateful set 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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user