MCPcopy
hub / github.com/kubernetes/client-go / Run

Method Run

tools/cache/controller.go:100–125  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

98// It's an error to call Run more than once.
99// Run blocks; call via go.
100func (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
128func (c *controller) HasSynced() bool {

Callers

nothing calls this directly

Calls 2

NewReflectorFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected