summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/client-go/rest/transport.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/k8s.io/client-go/rest/transport.go')
-rw-r--r--vendor/k8s.io/client-go/rest/transport.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/k8s.io/client-go/rest/transport.go b/vendor/k8s.io/client-go/rest/transport.go
index 878c6abf1..b6a067632 100644
--- a/vendor/k8s.io/client-go/rest/transport.go
+++ b/vendor/k8s.io/client-go/rest/transport.go
@@ -20,6 +20,7 @@ import (
"crypto/tls"
"net/http"
+ "k8s.io/client-go/plugin/pkg/client/auth/exec"
"k8s.io/client-go/transport"
)
@@ -59,6 +60,20 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip
// TransportConfig converts a client config to an appropriate transport config.
func (c *Config) TransportConfig() (*transport.Config, error) {
wt := c.WrapTransport
+ if c.ExecProvider != nil {
+ provider, err := exec.GetAuthenticator(c.ExecProvider)
+ if err != nil {
+ return nil, err
+ }
+ if wt != nil {
+ previousWT := wt
+ wt = func(rt http.RoundTripper) http.RoundTripper {
+ return provider.WrapTransport(previousWT(rt))
+ }
+ } else {
+ wt = provider.WrapTransport
+ }
+ }
if c.AuthProvider != nil {
provider, err := GetAuthProvider(c.Host, c.AuthProvider, c.AuthConfigPersister)
if err != nil {