From ff57dc608b506b8fa61e2f79d955e2690e659346 Mon Sep 17 00:00:00 2001 From: "mike.du" Date: Thu, 21 Nov 2019 12:16:51 +0800 Subject: [PATCH] feat add a function to set namespace of envsetting Signed-off-by: mike.du --- pkg/cli/environment.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go index 28e7873be..c63e420ea 100644 --- a/pkg/cli/environment.go +++ b/pkg/cli/environment.go @@ -121,6 +121,11 @@ func (s *EnvSettings) Namespace() string { return "default" } +//set the namespace of envsetting, provide easier integration for non-cli projects +func (s *EnvSettings) SetNameSpace(ns string) { + s.namespace = ns +} + //RESTClientGetter gets the kubeconfig from EnvSettings func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter { s.configOnce.Do(func() {