mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-13 21:15:27 +00:00
Revert "stop defaulting kubeconfig to http://localhost:8080"
This reverts commit b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee. Kubernetes-commit: a871738c86a0bdf7c3b8924d1932e6f2c85ea8d8
This commit is contained in:
parent
b3b874faea
commit
71473e9b7b
@ -35,7 +35,7 @@ import (
|
||||
var (
|
||||
// ClusterDefaults has the same behavior as the old EnvVar and DefaultCluster fields
|
||||
// DEPRECATED will be replaced
|
||||
ClusterDefaults = clientcmdapi.Cluster{Server: os.Getenv("KUBERNETES_MASTER")}
|
||||
ClusterDefaults = clientcmdapi.Cluster{Server: getDefaultServer()}
|
||||
// DefaultClientConfig represents the legacy behavior of this package for defaulting
|
||||
// DEPRECATED will be replace
|
||||
DefaultClientConfig = DirectClientConfig{*clientcmdapi.NewConfig(), "", &ConfigOverrides{
|
||||
@ -43,6 +43,15 @@ var (
|
||||
}, 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
|
||||
type ClientConfig interface {
|
||||
// RawConfig returns the merged result of all overrides
|
||||
|
Loading…
Reference in New Issue
Block a user