client-go: make exec auth and auth provider mutually exclusive

Kubernetes-commit: d96fd39651a4182ceb016c879a17c6a237c87f53
This commit is contained in:
Eric Chiang
2018-06-01 10:34:45 -07:00
committed by Kubernetes Publisher
parent a776f223c2
commit 15affbb73e

View File

@@ -18,6 +18,7 @@ package rest
import (
"crypto/tls"
"errors"
"net/http"
"k8s.io/client-go/plugin/pkg/client/auth/exec"
@@ -83,6 +84,11 @@ func (c *Config) TransportConfig() (*transport.Config, error) {
},
Dial: c.Dial,
}
if c.ExecProvider != nil && c.AuthProvider != nil {
return nil, errors.New("execProvider and authProvider cannot be used in combination")
}
if c.ExecProvider != nil {
provider, err := exec.GetAuthenticator(c.ExecProvider)
if err != nil {