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

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

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

Loading…
Cancel
Save