mirror of
https://github.com/kubernetes/client-go.git
synced 2026-05-16 20:37:09 +00:00
client-go exec: make sure round tripper can be unwrapped
Signed-off-by: Monis Khan <mok@vmware.com> Kubernetes-commit: 02b0b8d4c8daa2030672de6d6dbc86b009f5db32
This commit is contained in:
committed by
Kubernetes Publisher
parent
48190f8df6
commit
6f28fe1a58
@@ -39,6 +39,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"k8s.io/apimachinery/pkg/util/clock"
|
||||
utilnet "k8s.io/apimachinery/pkg/util/net"
|
||||
"k8s.io/client-go/pkg/apis/clientauthentication"
|
||||
"k8s.io/client-go/pkg/apis/clientauthentication/install"
|
||||
clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1"
|
||||
@@ -316,11 +317,17 @@ func (a *Authenticator) UpdateTransportConfig(c *transport.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ utilnet.RoundTripperWrapper = &roundTripper{}
|
||||
|
||||
type roundTripper struct {
|
||||
a *Authenticator
|
||||
base http.RoundTripper
|
||||
}
|
||||
|
||||
func (r *roundTripper) WrappedRoundTripper() http.RoundTripper {
|
||||
return r.base
|
||||
}
|
||||
|
||||
func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
// If a user has already set credentials, use that. This makes commands like
|
||||
// "kubectl get --token (token) pods" work.
|
||||
|
||||
Reference in New Issue
Block a user