@@ -26,6 +26,7 @@ import (
26
26
27
27
// WARNING: Do not use path/filepath in this package unless you want bizarre Windows paths
28
28
29
+ "strconv"
29
30
"strings"
30
31
"time"
31
32
@@ -105,7 +106,7 @@ func (k *Bootstrapper) GetKubeletStatus() (string, error) {
105
106
106
107
// GetAPIServerStatus returns the api-server status
107
108
func (k * Bootstrapper ) GetAPIServerStatus (ip net.IP , apiserverPort int ) (string , error ) {
108
- url := fmt .Sprintf ("https://%s:%d /healthz" , ip , apiserverPort )
109
+ url := fmt .Sprintf ("https://%s/healthz" , net . JoinHostPort ( ip . String (), strconv . Itoa ( apiserverPort )) )
109
110
// To avoid: x509: certificate signed by unknown authority
110
111
tr := & http.Transport {
111
112
Proxy : nil , // To avoid connectiv issue if http(s)_proxy is set.
@@ -300,7 +301,7 @@ func (k *Bootstrapper) client(k8s config.KubernetesConfig) (*kubernetes.Clientse
300
301
return nil , errors .Wrap (err , "client config" )
301
302
}
302
303
303
- endpoint := fmt .Sprintf ("https://%s:%d " , k8s .NodeIP , k8s .NodePort )
304
+ endpoint := fmt .Sprintf ("https://%s" , net . JoinHostPort ( k8s .NodeIP , strconv . Itoa ( k8s .NodePort )) )
304
305
if config .Host != endpoint {
305
306
glog .Errorf ("Overriding stale ClientConfig host %s with %s" , config .Host , endpoint )
306
307
config .Host = endpoint
0 commit comments