mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-15 14:03:09 +00:00
stop defaulting kubeconfig to http://localhost:8080
Kubernetes-commit: b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee
This commit is contained in:
parent
03ea996864
commit
72322d0c6d
@ -35,7 +35,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// ClusterDefaults has the same behavior as the old EnvVar and DefaultCluster fields
|
// ClusterDefaults has the same behavior as the old EnvVar and DefaultCluster fields
|
||||||
// DEPRECATED will be replaced
|
// DEPRECATED will be replaced
|
||||||
ClusterDefaults = clientcmdapi.Cluster{Server: getDefaultServer()}
|
ClusterDefaults = clientcmdapi.Cluster{Server: os.Getenv("KUBERNETES_MASTER")}
|
||||||
// DefaultClientConfig represents the legacy behavior of this package for defaulting
|
// DefaultClientConfig represents the legacy behavior of this package for defaulting
|
||||||
// DEPRECATED will be replace
|
// DEPRECATED will be replace
|
||||||
DefaultClientConfig = DirectClientConfig{*clientcmdapi.NewConfig(), "", &ConfigOverrides{
|
DefaultClientConfig = DirectClientConfig{*clientcmdapi.NewConfig(), "", &ConfigOverrides{
|
||||||
@ -43,15 +43,6 @@ var (
|
|||||||
}, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}}
|
}, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}}
|
||||||
)
|
)
|
||||||
|
|
||||||
// getDefaultServer returns a default setting for DefaultClientConfig
|
|
||||||
// DEPRECATED
|
|
||||||
func getDefaultServer() string {
|
|
||||||
if server := os.Getenv("KUBERNETES_MASTER"); len(server) > 0 {
|
|
||||||
return server
|
|
||||||
}
|
|
||||||
return "http://localhost:8080"
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClientConfig is used to make it easy to get an api server client
|
// ClientConfig is used to make it easy to get an api server client
|
||||||
type ClientConfig interface {
|
type ClientConfig interface {
|
||||||
// RawConfig returns the merged result of all overrides
|
// RawConfig returns the merged result of all overrides
|
||||||
|
Loading…
Reference in New Issue
Block a user