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 2 months ago committed by Scott Rigby
parent 31bd995ce2
commit 1e3ee1d2ba
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

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