Skip to content

Commit

Permalink
fix: cached namespaces (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone authored Oct 26, 2023
1 parent bf54acb commit 9903eee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,21 @@ func main() {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
}
ctrlOptions.NewCache = cache.MultiNamespacedCacheBuilder(bentoDeploymentNamespaces)
setupLog.Info("starting manager", "bento deployment namespaces", bentoDeploymentNamespaces)
namespaces := bentoDeploymentNamespaces
namespaces = append(namespaces, commonconfig.GetYataiSystemNamespaceFromEnv())
ctrlOptions.NewCache = cache.MultiNamespacedCacheBuilder(namespaces)
setupLog.Info("starting manager", "cached namespaces", namespaces)
} else {
setupLog.Info("starting manager", "bento deployment namespaces", "all")
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrlOptions)
mgr, err := ctrl.NewManager(restConf, ctrlOptions)
if err != nil {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
}

discoveryClient, err := discovery.NewDiscoveryClientForConfig(ctrl.GetConfigOrDie())
discoveryClient, err := discovery.NewDiscoveryClientForConfig(restConf)
if err != nil {
setupLog.Error(err, "unable to create discovery client")
os.Exit(1)
Expand Down

0 comments on commit 9903eee

Please sign in to comment.