Commit 14dc376e authored by John Belamaric's avatar John Belamaric Committed by Miek Gieben

Enable use of a service account in-cluster. (#349)

parent 9a048663
......@@ -50,6 +50,12 @@ func (k *Kubernetes) getClientConfig() (*restclient.Config, error) {
authinfo := clientcmdapi.AuthInfo{}
if len(k.APIEndpoint) > 0 {
clusterinfo.Server = k.APIEndpoint
} else {
cc, err := restclient.InClusterConfig()
if err != nil {
return nil, err
}
return cc, err
}
if len(k.APICertAuth) > 0 {
clusterinfo.CertificateAuthority = k.APICertAuth
......
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