Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look at all namespace unless overridden #370

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading