From 729236b4d20ac793d5b5072670527a7d28944671 Mon Sep 17 00:00:00 2001 From: forevermatt Date: Tue, 14 May 2024 15:46:42 -0400 Subject: [PATCH 1/4] Keep `proxyConfiguration`, if present --- ecs-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecs-deploy b/ecs-deploy index 25478cc..b8a3a66 100755 --- a/ecs-deploy +++ b/ecs-deploy @@ -374,7 +374,7 @@ function createNewTaskDefJson() { # Some options in task definition should only be included in new definition if present in # current definition. If found in current definition, append to JQ filter. - CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage) + CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage, proxyConfiguration) for i in "${CONDITIONAL_OPTIONS[@]}"; do re=".*${i}.*" if [[ "$DEF" =~ $re ]]; then From a79f5224b9c4c803478975a22d5b98c7fd290eb9 Mon Sep 17 00:00:00 2001 From: Matt H Date: Tue, 14 May 2024 15:55:23 -0400 Subject: [PATCH 2/4] Fix incorrect use of comma (not just space) as separator in list --- ecs-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecs-deploy b/ecs-deploy index b8a3a66..b93fce6 100755 --- a/ecs-deploy +++ b/ecs-deploy @@ -374,7 +374,7 @@ function createNewTaskDefJson() { # Some options in task definition should only be included in new definition if present in # current definition. If found in current definition, append to JQ filter. - CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage, proxyConfiguration) + CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage proxyConfiguration) for i in "${CONDITIONAL_OPTIONS[@]}"; do re=".*${i}.*" if [[ "$DEF" =~ $re ]]; then From ed89721d00e214dfe00ac64aaa886b5459e85b6b Mon Sep 17 00:00:00 2001 From: Matt H Date: Tue, 14 May 2024 16:02:40 -0400 Subject: [PATCH 3/4] Duplicate existing test (unchanged) as starting point for new test --- test.bats | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/test.bats b/test.bats index 698daf8..3cb44d8 100755 --- a/test.bats +++ b/test.bats @@ -686,3 +686,60 @@ EOF [ "$output" == "something:tag_123" ] echo "output = $output" 1>&2 } + +@test "test createNewTaskDefJson with single container in definition" { + imageWithoutTag="121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo" + useImage="121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo:1111111111" + TASK_DEFINITION=$(cat < Date: Tue, 14 May 2024 16:15:13 -0400 Subject: [PATCH 4/4] Modify duplicate test to prove `proxyConfiguration` is preserved --- test.bats | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test.bats b/test.bats index 3cb44d8..00d0e95 100755 --- a/test.bats +++ b/test.bats @@ -687,7 +687,7 @@ EOF echo "output = $output" 1>&2 } -@test "test createNewTaskDefJson with single container in definition" { +@test "test createNewTaskDefJson with existing proxyConfiguration value" { imageWithoutTag="121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo" useImage="121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo:1111111111" TASK_DEFINITION=$(cat <