From 8e0d288b2e542099c72a5de536b55a400d26fdb9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 19 Jun 2020 17:46:58 -0400 Subject: [PATCH] fix: filter args _after_ docker-args-process-deploy The new hook is what is used to expose resource limits/reservations by the resource plugin. --- plugins/app-json/internal-functions | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/app-json/internal-functions b/plugins/app-json/internal-functions index 97e04909a..8f72fd9fb 100755 --- a/plugins/app-json/internal-functions +++ b/plugins/app-json/internal-functions @@ -82,16 +82,16 @@ execute_script() { [[ -d $CACHE_DIR ]] || mkdir -p "$CACHE_DIR" local DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG") - # strip certain args from DOCKER_ARGS - local filtered_args=("restart" "cpus" "memory" "memory-swap" "gpus" "memory-reservation") - for filtered_arg in "${filtered_args[@]}"; do - DOCKER_ARGS=$(sed -e "s/--${filtered_arg}=[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS") - done - local IMAGE_SOURCE_TYPE="dockerfile" is_image_herokuish_based "$IMAGE" "$APP" && IMAGE_SOURCE_TYPE="herokuish" DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG") + # strip certain args from DOCKER_ARGS + local filtered_args=("restart" "cpus" "memory" "memory-swap" "memory-reservation" "nvidia-gpu") + for filtered_arg in "${filtered_args[@]}"; do + DOCKER_ARGS=$(sed -e "s/--${filtered_arg}=[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS") + done + # eval args as array to respect escapes declare -a ARG_ARRAY eval "ARG_ARRAY=($DOCKER_ARGS)"