mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-03 08:04:45 +00:00
restclient should not depend on api/core/v1
Kubernetes-commit: 847edc0e27054f1bf7771ba8d412b10bfd533f90
This commit is contained in:
committed by
Kubernetes Publisher
parent
7130d1acc2
commit
a6f5cf653e
@@ -29,7 +29,6 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
@@ -316,12 +315,12 @@ func InClusterConfig() (*Config, error) {
|
|||||||
return nil, fmt.Errorf("unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined")
|
return nil, fmt.Errorf("unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined")
|
||||||
}
|
}
|
||||||
|
|
||||||
token, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/" + v1.ServiceAccountTokenKey)
|
token, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/token")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
tlsClientConfig := TLSClientConfig{}
|
tlsClientConfig := TLSClientConfig{}
|
||||||
rootCAFile := "/var/run/secrets/kubernetes.io/serviceaccount/" + v1.ServiceAccountRootCAKey
|
rootCAFile := "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
|
||||||
if _, err := certutil.NewPool(rootCAFile); err != nil {
|
if _, err := certutil.NewPool(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 {
|
||||||
|
Reference in New Issue
Block a user