Browse Source

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 <abalexandrebarone@gmail.com>
pull/4138/head
devodev 10 months ago committed by Alexandre Barone
parent
commit
efcb0d1f4e
  1. 1
      connector/google/google_test.go

1
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{

Loading…
Cancel
Save