From 54eed52a6b037f7a97c19e9af1277a5eb4a55a3a Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 19 Dec 2023 16:32:52 +0100 Subject: [PATCH] Properly configure namespace selector This accidentally did not get `if`-wrapped in eaa2a8c2fe78e3b7d5aa9fcedc7757b3c4005f51, breaking the configuration option to watch a single namespace, and thereby as by-effect the breakage of sharding. Signed-off-by: Hidde Beydals --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 2f8349744..9d87b6edf 100644 --- a/main.go +++ b/main.go @@ -228,8 +228,10 @@ func main() { }, } - mgrConfig.Cache.DefaultNamespaces = map[string]ctrlcache.Config{ - watchNamespace: {}, + if watchNamespace != "" { + mgrConfig.Cache.DefaultNamespaces = map[string]ctrlcache.Config{ + watchNamespace: ctrlcache.Config{}, + } } mgr, err := ctrl.NewManager(restConfig, mgrConfig)