tolerate newer golang/oauth2 version

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 32aa52adf667d7873eaed8094fc5489a93517e38
This commit is contained in:
Davanum Srinivas 2025-06-07 19:52:48 -04:00 committed by Kubernetes Publisher
parent 12398ddf4e
commit f7066acf25

View File

@ -220,7 +220,10 @@ func TestTokenSourceTransportRoundTrip(t *testing.T) {
cachedTokenSource.tok = test.cachedToken
rt := ResettableTokenSourceWrapTransport(cachedTokenSource)(&testTransport{})
// workaround for https://github.com/golang/oauth2/pull/779
if test.header == nil {
test.header = make(http.Header)
}
rt.RoundTrip(&http.Request{Header: test.header})
if tts.calls != test.wantCalls {
t.Errorf("RoundTrip() called Token() = %d times, want %d", tts.calls, test.wantCalls)