From efcb0d1f4e0b22b4567eb08a9bcbdb9145ddcd4b Mon Sep 17 00:00:00 2001 From: devodev Date: Sat, 17 May 2025 21:26:28 -0400 Subject: [PATCH] google: fix TestGCEWorkloadIdentity fail on windows with existing creds The google oauth2 package uses different heuristics to try and find credentials. To avoid detecting user credentials, we already cover comon locaction for unix-based systems such as HOME. On the other hand, on windows it is possible tok find existing credentials under $APPDATA, therefore to mitigate, set the env var to /tmp like we do for HOME. Signed-off-by: Alexandre Barone --- connector/google/google_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/connector/google/google_test.go b/connector/google/google_test.go index e589403b..46f77ff7 100644 --- a/connector/google/google_test.go +++ b/connector/google/google_test.go @@ -425,6 +425,7 @@ func TestGCEWorkloadIdentity(t *testing.T) { os.Setenv("GCE_METADATA_HOST", metadataServerHost) os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", "") os.Setenv("HOME", "/tmp") + os.Setenv("APPDATA", "/tmp") gceMetadataFlags["failOnEmailRequest"] = true _, err := newConnector(&Config{