From bbd04cde413d69d9ad13d0ebcafc0f774b4d2ae8 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 9 Dec 2016 14:14:13 -0500 Subject: [PATCH] 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 --- pkg/client/restclient/url_utils.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/client/restclient/url_utils.go b/pkg/client/restclient/url_utils.go index 1f65e4b5b80..d62e19a0577 100644 --- a/pkg/client/restclient/url_utils.go +++ b/pkg/client/restclient/url_utils.go @@ -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://"