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

Method Delete

internal/pkg/controller/controller.go:258–283  ·  view source on GitHub ↗

Delete function to add an object to the queue in case of deleting a resource

(old interface{})

Source from the content-addressed store, hash-verified

256
257// Delete function to add an object to the queue in case of deleting a resource
258func (c *Controller) Delete(old interface{}) {
259 c.collectors.RecordEventReceived("delete", c.resource)
260
261 if _, ok := old.(*csiv1.SecretProviderClassPodStatus); ok {
262 return
263 }
264
265 if options.ReloadOnDelete == "true" {
266 if !c.resourceInIgnoredNamespace(old) && c.resourceInSelectedNamespaces(old) && secretControllerInitialized.Load() && configmapControllerInitialized.Load() {
267 c.enqueue(handler.ResourceDeleteHandler{
268 Resource: old,
269 Collectors: c.collectors,
270 Recorder: c.recorder,
271 EnqueueTime: time.Now(),
272 })
273 } else {
274 c.collectors.RecordSkipped("ignored_or_not_selected")
275 }
276 }
277
278 switch object := old.(type) {
279 case *v1.Namespace:
280 c.removeSelectedNamespaceFromCache(*object)
281 return
282 }
283}
284
285// enqueue adds an item to the queue and records metrics
286func (c *Controller) enqueue(item interface{}) {

Callers

nothing calls this directly

Calls 6

enqueueMethod · 0.95
RecordEventReceivedMethod · 0.80
RecordSkippedMethod · 0.80

Tested by

no test coverage detected