Code Review Changes

Signed-off-by: Aaron Mell <amell@lumindigital.com>
pull/6660/head
Aaron Mell 5 years ago
parent 4eca26e4e1
commit 6a98d1f1d2

@ -211,7 +211,7 @@ func (c *Configuration) recordRelease(r *release.Release) {
// InitActionConfig initializes the action configuration
func (c *Configuration) Init(envSettings *cli.EnvSettings, allNamespaces bool, helmDriver string, log DebugLog) error {
getter := envSettings.RestClientGetter()
getter := envSettings.RESTClientGetter()
kc := kube.New(getter)
kc.Log = log

@ -38,8 +38,7 @@ import (
// EnvSettings describes all of the environment settings.
type EnvSettings struct {
namespace string
//kubeConfig string
namespace string
config genericclioptions.RESTClientGetter
configOnce sync.Once
@ -116,14 +115,14 @@ func (s *EnvSettings) Namespace() string {
return s.namespace
}
if ns, _, err := s.RestClientGetter().ToRawKubeConfigLoader().Namespace(); err == nil {
if ns, _, err := s.RESTClientGetter().ToRawKubeConfigLoader().Namespace(); err == nil {
return ns
}
return "default"
}
//KubeConfig gets the kubeconfig from EnvSettings
func (s *EnvSettings) RestClientGetter() genericclioptions.RESTClientGetter {
//RESTClientGetter gets the kubeconfig from EnvSettings
func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter {
s.configOnce.Do(func() {
s.config = kube.GetConfig(s.KubeConfig, s.KubeContext, s.namespace)
})

Loading…
Cancel
Save