Skip to content

Commit a630cc6

Browse files
committed
fix handling of eks
1 parent c01b864 commit a630cc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.evergreen/scripts/oidc_tester.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ def _get_target_dir(sub_test_name: str) -> str:
2525
def setup_oidc(sub_test_name: str) -> dict[str, str] | None:
2626
target_dir = _get_target_dir(sub_test_name)
2727
env = os.environ.copy()
28+
if sub_test_name == "eks" and "AWS_ACCESS_KEY_ID" in os.environ:
29+
# Remove AWS creds that would interfere with kubectl access.
30+
for key in ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]:
31+
if key in os.environ:
32+
del os.environ[key]
2833
if sub_test_name == "azure":
2934
env["AZUREOIDC_VMNAME_PREFIX"] = "PYTHON_DRIVER"
3035
if "-remote" not in sub_test_name:

0 commit comments

Comments
 (0)