Skip to content

Commit

Permalink
DRIVERS-2747 Handle backwards compat for ECS task definition (#370)
Browse files Browse the repository at this point in the history
* DRIVERS-2747 Handle backwards compat

* fix dict access
  • Loading branch information
blink1073 committed Nov 7, 2023
1 parent 58013d0 commit 5da5037
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .evergreen/auth_aws/aws_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,14 @@ def setup_ecs():
with open('/etc/lsb-release') as fid:
text = fid.read()
if 'jammy' in text:
task_definition = CONFIG[get_key('iam_auth_ecs_task_definition_jammy')]
task_definition = CONFIG.get(get_key('iam_auth_ecs_task_definition_jammy'), None)
if task_definition is None:
raise ValueError('Please set "iam_auth_ecs_task_definition_jammy" variable')
elif 'focal' in text:
task_definition = CONFIG[get_key('iam_auth_ecs_task_definition_focal')]
task_definition = CONFIG.get(get_key('iam_auth_ecs_task_definition_focal'), None)
# Fall back to previous task definition for backward compat.
if task_definition is None:
task_definition = CONFIG[get_key('iam_auth_ecs_task_definition')]
else:
raise ValueError('Unsupported ubuntu release')
run_test_command = f"{base_command} -d -v run_e2e_test --cluster {CONFIG[get_key('iam_auth_ecs_cluster')]} --task_definition {task_definition} --subnets {CONFIG[get_key('iam_auth_ecs_subnet_a')]} --subnets {CONFIG[get_key('iam_auth_ecs_subnet_b')]} --security_group {CONFIG[get_key('iam_auth_ecs_security_group')]} --files {mongo_binaries}/mongod:/root/mongod {mongo_binaries}/mongosh:/root/mongosh lib/ecs_hosted_test.js:/root/ecs_hosted_test.js {project_dir}:/root --script lib/ecs_hosted_test.sh"
Expand Down

0 comments on commit 5da5037

Please sign in to comment.