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

Method Invokes

testing/fake.go:130–150  ·  testing/fake.go::Fake.Invokes

Invokes records the provided Action and then invokes the ReactionFunc that handles the action if one exists. defaultReturnObj is expected to be of the same type a normal call would return.

(action Action, defaultReturnObj runtime.Object)

Source from the content-addressed store, hash-verified

128// handles the action if one exists. defaultReturnObj is expected to be of the
129// same type a normal call would return.
130func (c *Fake) Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error) {
131 c.Lock()
132 defer c.Unlock()
133
134 actionCopy := action.DeepCopy()
135 c.actions = append(c.actions, action.DeepCopy())
136 for _, reactor := range c.ReactionChain {
137 if !reactor.Handles(actionCopy) {
138 continue
139 }
140
141 handled, ret, err := reactor.React(actionCopy)
142 if !handled {
143 continue
144 }
145
146 return ret, err
147 }
148
149 return defaultReturnObj, nil
150}
151
152// InvokesWatch records the provided Action and then invokes the ReactionFunc
153// that handles the action if one exists.

Callers 15

GetMethod · 0.80
UpdateMethod · 0.80
GetMethod · 0.80
ListMethod · 0.80
CreateMethod · 0.80
UpdateMethod · 0.80
UpdateStatusMethod · 0.80
DeleteMethod · 0.80
DeleteCollectionMethod · 0.80
PatchMethod · 0.80

Calls 3

DeepCopyMethod · 0.65
HandlesMethod · 0.65
ReactMethod · 0.65

Tested by 2