From aee5d84f45f92cc662955e78f79e59ffa089e7b2 Mon Sep 17 00:00:00 2001 From: waseem Date: Mon, 14 Oct 2019 14:20:17 +0200 Subject: [PATCH] Add to update method --- internal/pkg/controller/controller.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/pkg/controller/controller.go b/internal/pkg/controller/controller.go index 854b6ea1..b2d97a66 100644 --- a/internal/pkg/controller/controller.go +++ b/internal/pkg/controller/controller.go @@ -73,10 +73,12 @@ func (c *Controller) resourceInIgnoredNamespace(raw interface{}) bool { // Update function to add an old object and a new object to the queue in case of updating a resource func (c *Controller) Update(old interface{}, new interface{}) { - c.queue.Add(handler.ResourceUpdatedHandler{ - Resource: new, - OldResource: old, - }) + if !c.resourceInIgnoredNamespace(new) { + c.queue.Add(handler.ResourceUpdatedHandler{ + Resource: new, + OldResource: old, + }) + } } // Delete function to add an object to the queue in case of deleting a resource