Skip to content

Commit ca32468

Browse files
committed
fix handling of eks
1 parent b51e68a commit ca32468

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.evergreen/scripts/oidc_tester.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ def setup_oidc(sub_test_name: str) -> dict[str, str] | None:
3434
run_command(f"bash {target_dir}/run-self-test.sh")
3535
return None
3636

37+
if sub_test_name == "eks" and "AWS_ACCESS_KEY_ID" in os.environ:
38+
# Store AWS creds for kubectl access.
39+
for key in ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]:
40+
if key in os.environ:
41+
write_env(key, os.environ[key])
42+
3743
source_file = None
3844
if sub_test_name == "test":
3945
source_file = f"{target_dir}/secrets-export.sh"
@@ -60,11 +66,6 @@ def setup_oidc(sub_test_name: str) -> dict[str, str] | None:
6066
write_env("AZUREOIDC_RESOURCE", config["AZUREOIDC_RESOURCE"])
6167
elif sub_test_name == "gcp-remote":
6268
write_env("GCPOIDC_AUDIENCE", config["GCPOIDC_AUDIENCE"])
63-
elif sub_test_name == "eks" and "AWS_ACCESS_KEY_ID" in os.environ:
64-
# Store AWS creds for kubectl access.
65-
for key in ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]:
66-
if key in os.environ:
67-
write_env(key, os.environ[key])
6869
return config
6970

7071

0 commit comments

Comments
 (0)