fix(cli): handle nil config in EnvSettings.Namespace()

Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
pull/31613/head
Zadkiel AHARONIAN 9 months ago
parent 119341dca7
commit 8534663e73
No known key found for this signature in database
GPG Key ID: F6956DAE6ECCE1EA

@ -274,9 +274,11 @@ func (s *EnvSettings) EnvVars() map[string]string {
// Namespace gets the namespace from the configuration // Namespace gets the namespace from the configuration
func (s *EnvSettings) Namespace() string { func (s *EnvSettings) Namespace() string {
if s.config != nil {
if ns, _, err := s.config.ToRawKubeConfigLoader().Namespace(); err == nil { if ns, _, err := s.config.ToRawKubeConfigLoader().Namespace(); err == nil {
return ns return ns
} }
}
if s.namespace != "" { if s.namespace != "" {
return s.namespace return s.namespace
} }

Loading…
Cancel
Save