Skip to content

Commit

Permalink
Properly configure namespace selector
Browse files Browse the repository at this point in the history
This accidentally did not get `if`-wrapped in
eaa2a8c, breaking the configuration
option to watch a single namespace, and thereby as by-effect the
breakage of sharding.

Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Dec 19, 2023
1 parent 8094f19 commit a2b1f46
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ func main() {
},
}

mgrConfig.Cache.DefaultNamespaces = map[string]ctrlcache.Config{
watchNamespace: {},
if watchNamespace != "" {
mgrConfig.Cache.DefaultNamespaces = map[string]ctrlcache.Config{
watchNamespace: {},
}
}

mgr, err := ctrl.NewManager(restConfig, mgrConfig)
Expand Down

0 comments on commit a2b1f46

Please sign in to comment.