fix: correct issue where more complex docker args were not properly parsed when scheduling containers

In cases where a docker arg uses backticks - which may happen with docker labels - scheduled containers would fail to support these due to performing a double-eval. This is particularly noticeable for traefik labels, where backticks and parenthesis are common. This fix properly handles docker args as an array instead of performing an extra eval when scheduling containers.
This commit is contained in:
Jose Diaz-Gonzalez
2022-07-30 00:48:38 -04:00
parent bfe679fb50
commit d8e9511769
2 changed files with 28 additions and 3 deletions

View File

@@ -241,11 +241,11 @@ fn-scheduler-docker-local-start-app-container() {
declare APP="$1"
shift
local DOCKER_ARGS
declare -a DOCKER_ARGS
for i in "$@"; do
DOCKER_ARGS="$DOCKER_ARGS \"$i\""
DOCKER_ARGS+=("$i")
done
eval set -- $DOCKER_ARGS
set -- "${DOCKER_ARGS[@]}"
eval "$(config_export app "$APP" --merged)"
# shellcheck disable=SC2124