Run begins processing items, and will continue until a value is sent down stopCh. It's an error to call Run more than once. Run blocks; call via go.
(stopCh <-chan struct{})
| 98 | // It's an error to call Run more than once. |
| 99 | // Run blocks; call via go. |
| 100 | func (c *controller) Run(stopCh <-chan struct{}) { |
| 101 | defer utilruntime.HandleCrash() |
| 102 | go func() { |
| 103 | <-stopCh |
| 104 | c.config.Queue.Close() |
| 105 | }() |
| 106 | r := NewReflector( |
| 107 | c.config.ListerWatcher, |
| 108 | c.config.ObjectType, |
| 109 | c.config.Queue, |
| 110 | c.config.FullResyncPeriod, |
| 111 | ) |
| 112 | r.ShouldResync = c.config.ShouldResync |
| 113 | r.clock = c.clock |
| 114 | |
| 115 | c.reflectorMutex.Lock() |
| 116 | c.reflector = r |
| 117 | c.reflectorMutex.Unlock() |
| 118 | |
| 119 | var wg wait.Group |
| 120 | defer wg.Wait() |
| 121 | |
| 122 | wg.StartWithChannel(stopCh, r.Run) |
| 123 | |
| 124 | wait.Until(c.processLoop, time.Second, stopCh) |
| 125 | } |
| 126 | |
| 127 | // Returns true once this controller has completed an initial resource listing |
| 128 | func (c *controller) HasSynced() bool { |
nothing calls this directly
no test coverage detected