Commit beb895f2 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38519 from dims/fix-url-parse-in-golang-1.8

Automatic merge from submit-queue (batch tested with PRs 37677, 38519) 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 https://github.com/golang/go/commit/c5ccbdd22bdbdc43d541b7e7d4ed66ceb559030e Fixes #38380
parents fe9c4d69 bbd04cde
...@@ -33,10 +33,7 @@ func DefaultServerURL(host, apiPath string, groupVersion schema.GroupVersion, de ...@@ -33,10 +33,7 @@ func DefaultServerURL(host, apiPath string, groupVersion schema.GroupVersion, de
} }
base := host base := host
hostURL, err := url.Parse(base) hostURL, err := url.Parse(base)
if err != nil { if err != nil || hostURL.Scheme == "" || hostURL.Host == "" {
return nil, "", err
}
if hostURL.Scheme == "" || hostURL.Host == "" {
scheme := "http://" scheme := "http://"
if defaultTLS { if defaultTLS {
scheme = "https://" scheme = "https://"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment