Allow setting namespace in `helm template` without a kubeconfig

If you don't have a working kubeconfig, `helm template` does not respect
the `--namespace` option. It gets set on the settings object, but does
not get returned. `helm template` should not require a working
kubeconfig or any communication with a kubernetes cluster.

Signed-off-by: Alex Hunt <alex.hunt@materialize.com>
pull/12126/head
Alex Hunt 2 years ago
parent 1c4885fce7
commit 2a1a58d100

@ -223,6 +223,9 @@ func (s *EnvSettings) Namespace() string {
if ns, _, err := s.config.ToRawKubeConfigLoader().Namespace(); err == nil {
return ns
}
if s.namespace != "" {
return s.namespace
}
return "default"
}

Loading…
Cancel
Save