From f2a98233167364b53397ab6cdba2075d7786841c Mon Sep 17 00:00:00 2001 From: Eric Chiang Date: Fri, 1 Jun 2018 10:34:45 -0700 Subject: [PATCH] client-go: make exec auth and auth provider mutually exclusive Kubernetes-commit: d96fd39651a4182ceb016c879a17c6a237c87f53 --- rest/transport.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rest/transport.go b/rest/transport.go index 7f01823d..25c1801b 100644 --- a/rest/transport.go +++ b/rest/transport.go @@ -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 {