From f7066acf2519d1f898cfe1222751caaf2d858b8f Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sat, 7 Jun 2025 19:52:48 -0400 Subject: [PATCH] tolerate newer golang/oauth2 version Signed-off-by: Davanum Srinivas Kubernetes-commit: 32aa52adf667d7873eaed8094fc5489a93517e38 --- transport/token_source_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport/token_source_test.go b/transport/token_source_test.go index 956ea7c5..a3a84d66 100644 --- a/transport/token_source_test.go +++ b/transport/token_source_test.go @@ -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)