Skip to content

Commit db1c86e

Browse files
committed
retain cpu or memory if specified at the task level
1 parent 5daaca2 commit db1c86e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

ecs-deploy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Setup default values for variables
4-
VERSION="3.10.22"
4+
VERSION="3.10.23"
55
CLUSTER=false
66
SERVICE=false
77
TASK_DEFINITION=false
@@ -392,10 +392,9 @@ function createNewTaskDefJson() {
392392

393393
# Some options in task definition should only be included in new definition if present in
394394
# current definition. If found in current definition, append to JQ filter.
395-
CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage proxyConfiguration)
395+
CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage proxyConfiguration memory cpu)
396396
for i in "${CONDITIONAL_OPTIONS[@]}"; do
397-
re=".*${i}.*"
398-
if [[ "$DEF" =~ $re ]]; then
397+
if echo "$DEF" | jq --exit-status --arg key "$i" 'has($key)' >/dev/null; then
399398
NEW_DEF_JQ_FILTER="${NEW_DEF_JQ_FILTER}, ${i}: .${i}"
400399
fi
401400
done

0 commit comments

Comments
 (0)