MCPcopy
hub / github.com/kubernetes/client-go / RoundTrip

Method RoundTrip

plugin/pkg/client/auth/gcp/gcp.go:364–381  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

362var _ net.RoundTripperWrapper = &conditionalTransport{}
363
364func (t *conditionalTransport) RoundTrip(req *http.Request) (*http.Response, error) {
365 if len(req.Header.Get("Authorization")) != 0 {
366 return t.oauthTransport.Base.RoundTrip(req)
367 }
368
369 res, err := t.oauthTransport.RoundTrip(req)
370
371 if err != nil {
372 return nil, err
373 }
374
375 if res.StatusCode == 401 {
376 klog.V(4).Infof("The credentials that were supplied are invalid for the target cluster")
377 t.persister.Persist(t.resetCache)
378 }
379
380 return res, nil
381}
382
383func (t *conditionalTransport) WrappedRoundTripper() http.RoundTripper { return t.oauthTransport.Base }

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
PersistMethod · 0.65

Tested by

no test coverage detected