From cbcc305b78edb9fe65fc0edee99a5722a949287b Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Mon, 3 Aug 2020 23:57:02 +0530 Subject: [PATCH] Fixes unit tests when default kubeconfig namespace is not "default" (#4825) Use defaultNamespace from kubeconfig context Fixes #4779 Signed-off-by: Rajat Jindal --- cli/cmd/stat.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/cmd/stat.go b/cli/cmd/stat.go index fed464c03..84cc5407f 100644 --- a/cli/cmd/stat.go +++ b/cli/cmd/stat.go @@ -742,7 +742,7 @@ func (o *statOptions) validateConflictingFlags() error { return fmt.Errorf("--to-namespace and --from-namespace flags are mutually exclusive") } - if o.allNamespaces && o.namespace != "default" { + if o.allNamespaces && o.namespace != defaultNamespace { return fmt.Errorf("--all-namespaces and --namespace flags are mutually exclusive") } @@ -760,9 +760,9 @@ func (o *statOptions) validateNamespaceFlags() error { return fmt.Errorf("--from-namespace flag is incompatible with namespace resource type") } - // Note: technically, this allows you to say `stat ns --namespace default`, but that + // Note: technically, this allows you to say `stat ns --namespace `, but that // seems like an edge case. - if o.namespace != "default" { + if o.namespace != defaultNamespace { return fmt.Errorf("--namespace flag is incompatible with namespace resource type") }