Skip to content

Commit

Permalink
add cache opt
Browse files Browse the repository at this point in the history
  • Loading branch information
sivchari committed May 1, 2024
1 parent 269030b commit 1b97ebb
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,16 @@ func NewCommand() *cobra.Command {
os.Exit(1)
}

var cacheopt ctrlcache.Options
if watchedNamespace != "" {
cacheopt = ctrlcache.Options{
DefaultNamespaces: map[string]ctrlcache.Config{
watchedNamespace: {},
},
}
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Metrics: metricsserver.Options{
BindAddress: metricsAddr,
},
Cache: cacheopt,
Cache: ctrlcache.Options{
DefaultNamespaces: map[string]ctrlcache.Config{
watchedNamespace: {},
},
},
HealthProbeBindAddress: probeBindAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "58ac56fa.applicationsets.argoproj.io",
Expand Down

0 comments on commit 1b97ebb

Please sign in to comment.