client-go should not take a dependency on the v1 api lightly

These constants will never change, and tools/ should not be depending on
core/api/v1 (there is nothing v1 specific about them).
pull/8/head
Clayton Coleman 2018-04-25 18:02:30 -04:00
parent 029c1d8b23
commit aa9fd2bf11
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
3 changed files with 2 additions and 5 deletions

View File

@ -48,7 +48,6 @@ go_library(
"//vendor/github.com/imdario/mergo:go_default_library", "//vendor/github.com/imdario/mergo:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/golang.org/x/crypto/ssh/terminal:go_default_library", "//vendor/golang.org/x/crypto/ssh/terminal:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",

View File

@ -27,7 +27,6 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"github.com/imdario/mergo" "github.com/imdario/mergo"
"k8s.io/api/core/v1"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
clientauth "k8s.io/client-go/tools/auth" clientauth "k8s.io/client-go/tools/auth"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api" clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
@ -338,7 +337,7 @@ func (config *DirectClientConfig) Namespace() (string, bool, error) {
} }
if len(configContext.Namespace) == 0 { if len(configContext.Namespace) == 0 {
return v1.NamespaceDefault, false, nil return "default", false, nil
} }
return configContext.Namespace, false, nil return configContext.Namespace, false, nil

View File

@ -22,7 +22,6 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/api/core/v1"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api" clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
) )
@ -145,7 +144,7 @@ func (config *DeferredLoadingClientConfig) Namespace() (string, bool, error) {
if len(ns) > 0 { if len(ns) > 0 {
// if we got a non-default namespace from the kubeconfig, use it // if we got a non-default namespace from the kubeconfig, use it
if ns != v1.NamespaceDefault { if ns != "default" {
return ns, false, nil return ns, false, nil
} }