Run starts a watch and handles watch events. Will restart the watch if it is closed. Run will exit when stopCh is closed.
(stopCh <-chan struct{})
| 119 | // Run starts a watch and handles watch events. Will restart the watch if it is closed. |
| 120 | // Run will exit when stopCh is closed. |
| 121 | func (r *Reflector) Run(stopCh <-chan struct{}) { |
| 122 | klog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedType, r.resyncPeriod, r.name) |
| 123 | wait.Until(func() { |
| 124 | if err := r.ListAndWatch(stopCh); err != nil { |
| 125 | utilruntime.HandleError(err) |
| 126 | } |
| 127 | }, r.period, stopCh) |
| 128 | } |
| 129 | |
| 130 | var ( |
| 131 | // nothing will ever be sent down this channel |