MCPcopy Create free account
hub / github.com/stakater/Reloader / Update

Method Update

internal/pkg/controller/controller.go:236–255  ·  view source on GitHub ↗

Update function to add an old object and a new object to the queue in case of updating a resource

(old interface{}, new interface{})

Source from the content-addressed store, hash-verified

234
235// Update function to add an old object and a new object to the queue in case of updating a resource
236func (c *Controller) Update(old interface{}, new interface{}) {
237 c.collectors.RecordEventReceived("update", c.resource)
238
239 switch new.(type) {
240 case *v1.Namespace:
241 return
242 }
243
244 if !c.resourceInIgnoredNamespace(new) && c.resourceInSelectedNamespaces(new) {
245 c.enqueue(handler.ResourceUpdatedHandler{
246 Resource: new,
247 OldResource: old,
248 Collectors: c.collectors,
249 Recorder: c.recorder,
250 EnqueueTime: time.Now(),
251 })
252 } else {
253 c.collectors.RecordSkipped("ignored_or_not_selected")
254 }
255}
256
257// Delete function to add an object to the queue in case of deleting a resource
258func (c *Controller) Delete(old interface{}) {

Callers 15

PublishMetaInfoConfigmapFunction · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80

Calls 5

enqueueMethod · 0.95
RecordEventReceivedMethod · 0.80
RecordSkippedMethod · 0.80

Tested by 2

TestUpdateHandlerFunction · 0.64