Handle empty selector & ns label key not exists

This commit is contained in:
Avi Huli
2022-12-27 18:49:23 +02:00
parent 15d7263c95
commit e7cfafd6d6
+1 -3
View File
@@ -111,7 +111,6 @@ func (c *Controller) resourceInNamespaceSelector(raw interface{}) bool {
return false
}
}
return true
case *v1.Secret:
namespace, _ := c.client.CoreV1().Namespaces().Get(context.Background(), object.ObjectMeta.Namespace, metav1.GetOptions{})
for selectorKey, selectorVal := range c.namespaceSelector {
@@ -120,9 +119,8 @@ func (c *Controller) resourceInNamespaceSelector(raw interface{}) bool {
return false
}
}
return true
}
return false
return true
}
// Update function to add an old object and a new object to the queue in case of updating a resource