mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Do not hardcode version
The version is inferred automatically by client.New in SetKubernetesDefaults(), and also negotiated.
This commit is contained in:
parent
91589143a3
commit
873fa1067e
@ -244,7 +244,7 @@ func InClusterConfig() (*Config, error) {
|
|||||||
tlsClientConfig := TLSClientConfig{}
|
tlsClientConfig := TLSClientConfig{}
|
||||||
rootCAFile := "/var/run/secrets/kubernetes.io/serviceaccount/" + api.ServiceAccountRootCAKey
|
rootCAFile := "/var/run/secrets/kubernetes.io/serviceaccount/" + api.ServiceAccountRootCAKey
|
||||||
if _, err := util.CertPoolFromFile(rootCAFile); err != nil {
|
if _, err := util.CertPoolFromFile(rootCAFile); err != nil {
|
||||||
glog.Errorf("expected to load root ca config from %s, but got err: %v", rootCAFile, err)
|
glog.Errorf("expected to load root CA config from %s, but got err: %v", rootCAFile, err)
|
||||||
} else {
|
} else {
|
||||||
tlsClientConfig.CAFile = rootCAFile
|
tlsClientConfig.CAFile = rootCAFile
|
||||||
}
|
}
|
||||||
@ -252,7 +252,6 @@ func InClusterConfig() (*Config, error) {
|
|||||||
return &Config{
|
return &Config{
|
||||||
// TODO: switch to using cluster DNS.
|
// TODO: switch to using cluster DNS.
|
||||||
Host: "https://" + net.JoinHostPort(os.Getenv("KUBERNETES_SERVICE_HOST"), os.Getenv("KUBERNETES_SERVICE_PORT")),
|
Host: "https://" + net.JoinHostPort(os.Getenv("KUBERNETES_SERVICE_HOST"), os.Getenv("KUBERNETES_SERVICE_PORT")),
|
||||||
Version: "v1beta3",
|
|
||||||
BearerToken: string(token),
|
BearerToken: string(token),
|
||||||
TLSClientConfig: tlsClientConfig,
|
TLSClientConfig: tlsClientConfig,
|
||||||
}, nil
|
}, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user