From 1e3ee1d2ba5a421165fe053a41aa4071cf69ed62 Mon Sep 17 00:00:00 2001 From: Zadkiel AHARONIAN Date: Sun, 7 Dec 2025 17:09:13 +0100 Subject: [PATCH] fix(cli): handle nil config in EnvSettings.Namespace() Signed-off-by: Zadkiel AHARONIAN (cherry picked from commit 8534663e730f7d32ac8777c3b41a7e6c6a94ab96) --- pkg/cli/environment.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go index 60cce51a9..5c19734aa 100644 --- a/pkg/cli/environment.go +++ b/pkg/cli/environment.go @@ -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