Merge pull request #50775 from apelisse/fail-gke-failing-test

Automatic merge from submit-queue

client-go: Make conditionalTransport a WrapperRoundTripper

**What this PR does / why we need it**:
Fixes broken GKE test: https://k8s-gubernator.appspot.com/builds/kubernetes-jenkins/logs/ci-kubernetes-e2e-gke/

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

Kubernetes-commit: a9cceacdaea72d505d8827521f70123c8c2bbd73
This commit is contained in:
Kubernetes Publisher 2017-08-30 15:08:19 -07:00
commit 17da6b01b2
9 changed files with 72 additions and 48 deletions

96
Godeps/Godeps.json generated
View File

@ -456,195 +456,195 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "31421d9f8c2d6073628a89b4654fe22aced33167" "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/common", "ImportPath": "k8s.io/kube-openapi/pkg/common",

View File

@ -21,6 +21,7 @@ go_library(
"//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library",
"//vendor/github.com/Azure/go-autorest/autorest/azure:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest/azure:go_default_library",
"//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library",
], ],
) )

View File

@ -28,6 +28,7 @@ import (
"github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/azure"
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/apimachinery/pkg/util/net"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
) )
@ -113,6 +114,8 @@ type azureRoundTripper struct {
roundTripper http.RoundTripper roundTripper http.RoundTripper
} }
var _ net.RoundTripperWrapper = &azureRoundTripper{}
func (r *azureRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { func (r *azureRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
if len(req.Header.Get(authHeader)) != 0 { if len(req.Header.Get(authHeader)) != 0 {
return r.roundTripper.RoundTrip(req) return r.roundTripper.RoundTrip(req)
@ -137,6 +140,8 @@ func (r *azureRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)
return r.roundTripper.RoundTrip(req2) return r.roundTripper.RoundTrip(req2)
} }
func (r *azureRoundTripper) WrappedRoundTripper() http.RoundTripper { return r.roundTripper }
type azureToken struct { type azureToken struct {
token adal.Token token adal.Token
clientID string clientID string

View File

@ -21,6 +21,7 @@ go_library(
"//vendor/golang.org/x/net/context:go_default_library", "//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/oauth2:go_default_library", "//vendor/golang.org/x/oauth2:go_default_library",
"//vendor/golang.org/x/oauth2/google:go_default_library", "//vendor/golang.org/x/oauth2/google:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/yaml:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/yaml:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/util/jsonpath:go_default_library", "//vendor/k8s.io/client-go/util/jsonpath:go_default_library",

View File

@ -30,6 +30,7 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"golang.org/x/oauth2/google" "golang.org/x/oauth2/google"
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/util/yaml" "k8s.io/apimachinery/pkg/util/yaml"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
"k8s.io/client-go/util/jsonpath" "k8s.io/client-go/util/jsonpath"
@ -287,6 +288,8 @@ type conditionalTransport struct {
persister restclient.AuthProviderConfigPersister persister restclient.AuthProviderConfigPersister
} }
var _ net.RoundTripperWrapper = &conditionalTransport{}
func (t *conditionalTransport) RoundTrip(req *http.Request) (*http.Response, error) { func (t *conditionalTransport) RoundTrip(req *http.Request) (*http.Response, error) {
if len(req.Header.Get("Authorization")) != 0 { if len(req.Header.Get("Authorization")) != 0 {
return t.oauthTransport.Base.RoundTrip(req) return t.oauthTransport.Base.RoundTrip(req)
@ -306,3 +309,5 @@ func (t *conditionalTransport) RoundTrip(req *http.Request) (*http.Response, err
return res, nil return res, nil
} }
func (t *conditionalTransport) WrappedRoundTripper() http.RoundTripper { return t.oauthTransport.Base }

View File

@ -18,6 +18,7 @@ go_library(
deps = [ deps = [
"//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/golang/glog:go_default_library",
"//vendor/golang.org/x/oauth2:go_default_library", "//vendor/golang.org/x/oauth2:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library",
], ],
) )

View File

@ -30,6 +30,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"k8s.io/apimachinery/pkg/util/net"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
) )
@ -189,6 +190,8 @@ type roundTripper struct {
wrapped http.RoundTripper wrapped http.RoundTripper
} }
var _ net.RoundTripperWrapper = &roundTripper{}
func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
if len(req.Header.Get("Authorization")) != 0 { if len(req.Header.Get("Authorization")) != 0 {
return r.wrapped.RoundTrip(req) return r.wrapped.RoundTrip(req)
@ -212,6 +215,8 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
return r.wrapped.RoundTrip(r2) return r.wrapped.RoundTrip(r2)
} }
func (t *roundTripper) WrappedRoundTripper() http.RoundTripper { return t.wrapped }
func (p *oidcAuthProvider) idToken() (string, error) { func (p *oidcAuthProvider) idToken() (string, error) {
p.mu.Lock() p.mu.Lock()
defer p.mu.Unlock() defer p.mu.Unlock()

View File

@ -18,6 +18,7 @@ go_library(
deps = [ deps = [
"//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/gophercloud/gophercloud/openstack:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library",
], ],
) )

View File

@ -25,6 +25,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"github.com/gophercloud/gophercloud/openstack" "github.com/gophercloud/gophercloud/openstack"
"k8s.io/apimachinery/pkg/util/net"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
) )
@ -102,6 +103,8 @@ type tokenRoundTripper struct {
tokenGetter TokenGetter tokenGetter TokenGetter
} }
var _ net.RoundTripperWrapper = &tokenRoundTripper{}
// RoundTrip adds the bearer token into the request. // RoundTrip adds the bearer token into the request.
func (t *tokenRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { func (t *tokenRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
// if the authorization header already present, use it. // if the authorization header already present, use it.
@ -119,6 +122,8 @@ func (t *tokenRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)
return t.RoundTripper.RoundTrip(req) return t.RoundTripper.RoundTrip(req)
} }
func (t *tokenRoundTripper) WrappedRoundTripper() http.RoundTripper { return t.RoundTripper }
// newOpenstackAuthProvider creates an auth provider which works with openstack // newOpenstackAuthProvider creates an auth provider which works with openstack
// environment. // environment.
func newOpenstackAuthProvider(clusterAddress string, config map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) { func newOpenstackAuthProvider(clusterAddress string, config map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {