Skip to content

Commit

Permalink
Merge pull request #348 from iamniting/multi
Browse files Browse the repository at this point in the history
Watch for specific set of namespaces using the client
  • Loading branch information
openshift-merge-bot[bot] authored Nov 30, 2023
2 parents 23a2f28 + ad3da78 commit dc9302e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func main() {
os.Exit(1)
}

defaultNamespaces := map[string]cache.Config{
operatorNamespace: {},
"openshift-storage-extended": {},
}

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Expand All @@ -103,7 +108,7 @@ func main() {
LeaderElection: enableLeaderElection,
LeaderElectionID: "4fd470de.openshift.io",
LeaderElectionNamespace: operatorNamespace,
Cache: cache.Options{DefaultNamespaces: map[string]cache.Config{operatorNamespace: {}}},
Cache: cache.Options{DefaultNamespaces: defaultNamespaces},
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit dc9302e

Please sign in to comment.