Enable use of a service account in-cluster. (#349)
This commit is contained in:
parent
9a048663cf
commit
14dc376ee7
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue