Merge pull request #5273 from dokku/complex-docker-args
Correct issue where more complex docker args were not properly parsed when scheduling containers
This commit is contained in:
@@ -241,11 +241,11 @@ fn-scheduler-docker-local-start-app-container() {
|
|||||||
declare APP="$1"
|
declare APP="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
local DOCKER_ARGS
|
declare -a DOCKER_ARGS
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
DOCKER_ARGS="$DOCKER_ARGS \"$i\""
|
DOCKER_ARGS+=("$i")
|
||||||
done
|
done
|
||||||
eval set -- $DOCKER_ARGS
|
set -- "${DOCKER_ARGS[@]}"
|
||||||
|
|
||||||
eval "$(config_export app "$APP" --merged)"
|
eval "$(config_export app "$APP" --merged)"
|
||||||
# shellcheck disable=SC2124
|
# shellcheck disable=SC2124
|
||||||
|
|||||||
@@ -30,3 +30,28 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(scheduler-docker-local) complex labels" {
|
||||||
|
run create_app
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
# the run command is equivalent to the following line, except with backslashes due to the enclosing doublequotes
|
||||||
|
# dokku docker-options:add test deploy '--label "some.key=Host(\`$TEST_APP.dokku.me\`)"'
|
||||||
|
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy '--label \"some.key=Host(\\\`$TEST_APP.dokku.me\\\`)\"'"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run deploy_app
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "docker inspect --format '{{ index .Config.Labels \"some.key\"}}' $TEST_APP.web.1"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output "Host(\`$TEST_APP.dokku.me\`)"
|
||||||
|
assert_success
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user