WaitForCacheSync waits for caches to populate. It returns true if it was successful, false if the controller should shutdown
(stopCh <-chan struct{}, cacheSyncs ...InformerSynced)
| 158 | // WaitForCacheSync waits for caches to populate. It returns true if it was successful, false |
| 159 | // if the controller should shutdown |
| 160 | func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool { |
| 161 | err := wait.PollUntil(syncedPollPeriod, |
| 162 | func() (bool, error) { |
| 163 | for _, syncFunc := range cacheSyncs { |
| 164 | if !syncFunc() { |
| 165 | return false, nil |
| 166 | } |
| 167 | } |
| 168 | return true, nil |
| 169 | }, |
| 170 | stopCh) |
| 171 | if err != nil { |
| 172 | klog.V(2).Infof("stop requested") |
| 173 | return false |
| 174 | } |
| 175 | |
| 176 | klog.V(4).Infof("caches populated") |
| 177 | return true |
| 178 | } |
| 179 | |
| 180 | type sharedIndexInformer struct { |
| 181 | indexer Indexer |
no outgoing calls