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

Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
(cherry picked from commit 8534663e73)
release-4.0
Zadkiel AHARONIAN 10 months ago committed by Scott Rigby
parent 31bd995ce2
commit 1e3ee1d2ba
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -275,9 +275,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