mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
Better deal with failures under golang 1.8beta1
If there is any error in the initial parsing then we should just
try adding the scheme.
url.Parse(base) has changed in 1.8. Please see the following change
c5ccbdd22b
Fixes #38380
This commit is contained in:
parent
7168fce59a
commit
bbd04cde41
@ -33,10 +33,7 @@ func DefaultServerURL(host, apiPath string, groupVersion schema.GroupVersion, de
|
||||
}
|
||||
base := host
|
||||
hostURL, err := url.Parse(base)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
if hostURL.Scheme == "" || hostURL.Host == "" {
|
||||
if err != nil || hostURL.Scheme == "" || hostURL.Host == "" {
|
||||
scheme := "http://"
|
||||
if defaultTLS {
|
||||
scheme = "https://"
|
||||
|
Loading…
Reference in New Issue
Block a user