[VOL-1866] Changed module dependency to v12.0.0 of k8s client-go and v1.15.4 of k8s api/apimachinery in sync with other voltha components
Had to use pseudo-version corresponding to v12.0.0 of k8s client-go
because golang proxy is no longer serving the modules not complying
to Semantic Import Versioning rules including client-go v12.0.0.
Refer to https://github.com/kubernetes/client-go/issues/631 and
https://github.com/golang/go/issues/33558
Change-Id: I2e558bab7f0702f230761319eb5392a7d0532ea3
diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go
index dea229c..9c6ac3b 100644
--- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go
+++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go
@@ -228,12 +228,14 @@
// blindly overwrite existing values based on precedence
if len(configAuthInfo.Token) > 0 {
mergedConfig.BearerToken = configAuthInfo.Token
+ mergedConfig.BearerTokenFile = configAuthInfo.TokenFile
} else if len(configAuthInfo.TokenFile) > 0 {
- ts := restclient.NewCachedFileTokenSource(configAuthInfo.TokenFile)
- if _, err := ts.Token(); err != nil {
+ tokenBytes, err := ioutil.ReadFile(configAuthInfo.TokenFile)
+ if err != nil {
return nil, err
}
- mergedConfig.WrapTransport = restclient.TokenSourceWrapTransport(ts)
+ mergedConfig.BearerToken = string(tokenBytes)
+ mergedConfig.BearerTokenFile = configAuthInfo.TokenFile
}
if len(configAuthInfo.Impersonate) > 0 {
mergedConfig.Impersonate = restclient.ImpersonationConfig{
@@ -295,16 +297,6 @@
return config
}
-// makeUserIdentificationFieldsConfig returns a client.Config capable of being merged using mergo for only server identification information
-func makeServerIdentificationConfig(info clientauth.Info) restclient.Config {
- config := restclient.Config{}
- config.CAFile = info.CAFile
- if info.Insecure != nil {
- config.Insecure = *info.Insecure
- }
- return config
-}
-
func canIdentifyUser(config restclient.Config) bool {
return len(config.Username) > 0 ||
(len(config.CertFile) > 0 || len(config.CertData) > 0) ||
@@ -498,8 +490,9 @@
if server := config.overrides.ClusterInfo.Server; len(server) > 0 {
icc.Host = server
}
- if token := config.overrides.AuthInfo.Token; len(token) > 0 {
- icc.BearerToken = token
+ if len(config.overrides.AuthInfo.Token) > 0 || len(config.overrides.AuthInfo.TokenFile) > 0 {
+ icc.BearerToken = config.overrides.AuthInfo.Token
+ icc.BearerTokenFile = config.overrides.AuthInfo.TokenFile
}
if certificateAuthorityFile := config.overrides.ClusterInfo.CertificateAuthority; len(certificateAuthorityFile) > 0 {
icc.TLSClientConfig.CAFile = certificateAuthorityFile