kubeadm: respect user provided kubeconfig during discovery process

This commit is contained in:
SataQiu
2022-11-19 16:32:37 +08:00
parent 3f823c0daa
commit 21cd660a1f
6 changed files with 27 additions and 29 deletions

View File

@@ -31,7 +31,7 @@ import (
// RetrieveValidatedConfigInfo connects to the API Server and makes sure it can talk
// securely to the API Server using the provided CA cert and
// optionally refreshes the cluster-info information from the cluster-info ConfigMap
func RetrieveValidatedConfigInfo(httpsURL, clustername string, discoveryTimeout time.Duration) (*clientcmdapi.Config, error) {
func RetrieveValidatedConfigInfo(httpsURL string, discoveryTimeout time.Duration) (*clientcmdapi.Config, error) {
client := &http.Client{Transport: netutil.SetOldTransportDefaults(&http.Transport{})}
response, err := client.Get(httpsURL)
if err != nil {
@@ -48,5 +48,5 @@ func RetrieveValidatedConfigInfo(httpsURL, clustername string, discoveryTimeout
if err != nil {
return nil, err
}
return file.ValidateConfigInfo(config, clustername, discoveryTimeout)
return file.ValidateConfigInfo(config, discoveryTimeout)
}