Commit bbd04cde authored by Davanum Srinivas's avatar Davanum Srinivas

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
parent 7168fce5
......@@ -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://"
......
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