Update function to add an old object and a new object to the queue in case of updating a resource
(old interface{}, new interface{})
| 234 | |
| 235 | // Update function to add an old object and a new object to the queue in case of updating a resource |
| 236 | func (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 |
| 258 | func (c *Controller) Delete(old interface{}) { |