From 23f8b4e369f4af0acbd391b4c1d9b6c6ba2c1259 Mon Sep 17 00:00:00 2001 From: juanvallejo Date: Mon, 6 Aug 2018 15:40:55 -0400 Subject: [PATCH 1/2] UPSTREAM: 66929: add logging to find offending transports --- .../src/k8s.io/client-go/transport/round_trippers.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/transport/round_trippers.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/transport/round_trippers.go index 459a93760d63..9733cabae8f3 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/transport/round_trippers.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/transport/round_trippers.go @@ -138,7 +138,7 @@ func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented") + glog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -166,7 +166,7 @@ func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented") + glog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -197,7 +197,7 @@ func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented") + glog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -257,7 +257,7 @@ func (rt *impersonatingRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.delegate.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented") + glog.Errorf("CancelRequest not implemented by %T", rt.delegate) } } @@ -288,7 +288,7 @@ func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented") + glog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -372,7 +372,7 @@ func (rt *debuggingRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.delegatedRoundTripper.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented") + glog.Errorf("CancelRequest not implemented by %T", rt.delegatedRoundTripper) } } From 41a1b9f5fada65a63cdc094f9be3a0c36404cbe0 Mon Sep 17 00:00:00 2001 From: juanvallejo Date: Mon, 6 Aug 2018 15:34:54 -0400 Subject: [PATCH 2/2] UPSTREAM: 67024: add CancelRequest to discovery round-tripper --- .../src/k8s.io/client-go/discovery/round_tripper.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/round_tripper.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/round_tripper.go index 2e352b888f29..23cf8f4fc157 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/round_tripper.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/round_tripper.go @@ -21,6 +21,7 @@ import ( "net/http" "path/filepath" + "github.com/golang/glog" "github.com/gregjones/httpcache" "github.com/gregjones/httpcache/diskcache" "github.com/peterbourgon/diskv" @@ -48,4 +49,15 @@ func (rt *cacheRoundTripper) RoundTrip(req *http.Request) (*http.Response, error return rt.rt.RoundTrip(req) } +func (rt *cacheRoundTripper) CancelRequest(req *http.Request) { + type canceler interface { + CancelRequest(*http.Request) + } + if cr, ok := rt.rt.Transport.(canceler); ok { + cr.CancelRequest(req) + } else { + glog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport) + } +} + func (rt *cacheRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt.Transport }