Skip to content

Commit 389575b

Browse files
committed
use the predefined manager options to ensure proper defaults are used
Signed-off-by: everettraven <[email protected]>
1 parent f68d712 commit 389575b

File tree

1 file changed

+6
-7
lines changed
  • internal/cmd/ansible-operator/run

1 file changed

+6
-7
lines changed

internal/cmd/ansible-operator/run/cmd.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,13 @@ func run(cmd *cobra.Command, f *flags.Flags) {
179179
os.Exit(1)
180180
}
181181

182+
options.NewCache = func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
183+
return cache.New(config, cache.Options{
184+
Namespaces: watchNamespaces,
185+
})
186+
}
182187
// Create a new manager to provide shared dependencies and start components
183-
mgr, err := manager.New(cfg, manager.Options{
184-
NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
185-
return cache.New(config, cache.Options{
186-
Namespaces: watchNamespaces,
187-
})
188-
},
189-
})
188+
mgr, err := manager.New(cfg, options)
190189
if err != nil {
191190
log.Error(err, "Failed to create a new manager.")
192191
os.Exit(1)

0 commit comments

Comments
 (0)