Skip to content

Commit

Permalink
Look at all namespace unless overridden
Browse files Browse the repository at this point in the history
Signed-off-by: Willem Monsuwe <[email protected]>
  • Loading branch information
Willem Monsuwe authored and jacobweinstock committed Aug 13, 2024
1 parent f3ef245 commit 7cec338
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions internal/backend/kubernetes/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ func NewBackend(ctx context.Context, cfg Config) (*Backend, error) {

conf := func(opts *cluster.Options) {
opts.Scheme = scheme
opts.Cache.DefaultNamespaces = map[string]cache.Config{cfg.Namespace: {}}
if cfg.Namespace != "" {
opts.Cache.DefaultNamespaces = map[string]cache.Config{cfg.Namespace: {}}
}
}

clstr, err := cluster.New(cfg.ClientConfig, conf)
Expand Down Expand Up @@ -104,14 +106,6 @@ func loadConfig(cfg Config) (Config, error) {
}
cfg.ClientConfig = config

// In the event no namespace was provided for override, we need to fill it in with whatever
// namespace was loaded from the kubeconfig.
namespace, _, err := loader.Namespace()
if err != nil {
return Config{}, err
}
cfg.Namespace = namespace

return cfg, nil
}

Expand Down

0 comments on commit 7cec338

Please sign in to comment.