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

Method InvokesWatch

testing/fake.go:154–174  ·  view source on GitHub ↗

InvokesWatch records the provided Action and then invokes the ReactionFunc that handles the action if one exists.

(action Action)

Source from the content-addressed store, hash-verified

152// InvokesWatch records the provided Action and then invokes the ReactionFunc
153// that handles the action if one exists.
154func (c *Fake) InvokesWatch(action Action) (watch.Interface, error) {
155 c.Lock()
156 defer c.Unlock()
157
158 actionCopy := action.DeepCopy()
159 c.actions = append(c.actions, action.DeepCopy())
160 for _, reactor := range c.WatchReactionChain {
161 if !reactor.Handles(actionCopy) {
162 continue
163 }
164
165 handled, ret, err := reactor.React(actionCopy)
166 if !handled {
167 continue
168 }
169
170 return ret, err
171 }
172
173 return nil, fmt.Errorf("unhandled watch: %#v", action)
174}
175
176// InvokesProxy records the provided Action and then invokes the ReactionFunc
177// that handles the action if one exists.

Callers 15

WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80
WatchMethod · 0.80

Calls 4

DeepCopyMethod · 0.65
HandlesMethod · 0.65
ReactMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected