(stopCh <-chan struct{})
| 240 | } |
| 241 | |
| 242 | func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { |
| 243 | defer utilruntime.HandleCrash() |
| 244 | |
| 245 | fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, s.indexer) |
| 246 | |
| 247 | cfg := &Config{ |
| 248 | Queue: fifo, |
| 249 | ListerWatcher: s.listerWatcher, |
| 250 | ObjectType: s.objectType, |
| 251 | FullResyncPeriod: s.resyncCheckPeriod, |
| 252 | RetryOnError: false, |
| 253 | ShouldResync: s.processor.shouldResync, |
| 254 | |
| 255 | Process: s.HandleDeltas, |
| 256 | } |
| 257 | |
| 258 | func() { |
| 259 | s.startedLock.Lock() |
| 260 | defer s.startedLock.Unlock() |
| 261 | |
| 262 | s.controller = New(cfg) |
| 263 | s.controller.(*controller).clock = s.clock |
| 264 | s.started = true |
| 265 | }() |
| 266 | |
| 267 | // Separate stop channel because Processor should be stopped strictly after controller |
| 268 | processorStopCh := make(chan struct{}) |
| 269 | var wg wait.Group |
| 270 | defer wg.Wait() // Wait for Processor to stop |
| 271 | defer close(processorStopCh) // Tell Processor to stop |
| 272 | wg.StartWithChannel(processorStopCh, s.cacheMutationDetector.Run) |
| 273 | wg.StartWithChannel(processorStopCh, s.processor.run) |
| 274 | |
| 275 | defer func() { |
| 276 | s.startedLock.Lock() |
| 277 | defer s.startedLock.Unlock() |
| 278 | s.stopped = true // Don't want any new listeners |
| 279 | }() |
| 280 | s.controller.Run(stopCh) |
| 281 | } |
| 282 | |
| 283 | func (s *sharedIndexInformer) HasSynced() bool { |
| 284 | s.startedLock.Lock() |
nothing calls this directly
no test coverage detected