mirror of https://github.com/kubernetes/kops.git
Fix for validating kubeconfig's hosts
URL's Host field is "host" or "host:port". (see https://golang.org/pkg/net/url/#URL ) "host:port" can't be used as net.LookupHost's parameter. I recommend using URL.Hostname() instead of URL.Host.
This commit is contained in:
parent
7ff94b6f6a
commit
967f1e86c6
|
|
@ -72,7 +72,7 @@ func hasPlaceHolderIP(clusterName string) (bool, error) {
|
||||||
return true, fmt.Errorf("unable to parse Kubernetes cluster API URL: %v", err)
|
return true, fmt.Errorf("unable to parse Kubernetes cluster API URL: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
hostAddrs, err := net.LookupHost(apiAddr.Host)
|
hostAddrs, err := net.LookupHost(apiAddr.Hostname())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return true, fmt.Errorf("unable to resolve Kubernetes cluster API URL dns: %v", err)
|
return true, fmt.Errorf("unable to resolve Kubernetes cluster API URL dns: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue