Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Build in-cluster url using net/url
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano committed Oct 25, 2018
1 parent d1bbc0c commit 5f37ab9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"time"

Expand Down Expand Up @@ -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"}
Expand Down

0 comments on commit 5f37ab9

Please sign in to comment.