ref(environment): use string checking instead

It is more idiomatic to compare the string against the empty string than to check the string's length.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/7721/head
Matthew Fisher 6 years ago
parent 3dbc4dd53b
commit 14f6d1ea97
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -135,10 +135,10 @@ func (s *EnvSettings) Namespace() string {
func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter {
s.configOnce.Do(func() {
clientConfig := kube.GetConfig(s.KubeConfig, s.KubeContext, s.namespace)
if len(s.KubeToken) > 0 {
if s.KubeToken != "" {
clientConfig.BearerToken = &s.KubeToken
}
if len(s.KubeAPIServer) > 0 {
if s.KubeAPIServer != "" {
clientConfig.APIServer = &s.KubeAPIServer
}

Loading…
Cancel
Save