diff --git a/client.go b/client.go index 7df6e32..875d972 100644 --- a/client.go +++ b/client.go @@ -36,6 +36,7 @@ import ( "io/ioutil" "net" "net/http" + "net/url" "os" "time" @@ -221,8 +222,12 @@ func NewInClusterClient() (*Client, error) { return nil, err } + server := url.URL{ + Scheme: "https", + Host: net.JoinHostPort(host, port), + } cluster := Cluster{ - Server: "https://" + host + ":" + port, + Server: server.String(), CertificateAuthority: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt", } user := AuthInfo{TokenFile: "/var/run/secrets/kubernetes.io/serviceaccount/token"}