mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-03-25 13:28:34 +00:00
Fix preloading and parsing of arguments in the dind supervisor
We now remove the quotes from the image name in the ExecStartPre of the supervisor dind service, so that the images are properly pulled. We also fix the parsing of arguments in dindctl so that it correctly parses all of the arguments (the last one was being missed if it didn't have a parameter). Change-Type: patch Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
parent
8e1a38d610
commit
3771fd53ea
6
dindctl
6
dindctl
@ -52,7 +52,7 @@ function showHelp {
|
||||
}
|
||||
|
||||
function parseOptions {
|
||||
while [[ $# -gt 1 ]]
|
||||
while [[ $# -ge 1 ]]
|
||||
do
|
||||
case $1 in
|
||||
--mount-dist)
|
||||
@ -98,7 +98,7 @@ function buildSupervisor {
|
||||
|
||||
function buildSupervisorSrc {
|
||||
echo "Rebuilding supervisor source"
|
||||
( cd "$SUPERVISOR_BASE_DIR" && npm run build )
|
||||
( cd "$SUPERVISOR_BASE_DIR" && npm install && npm run build )
|
||||
}
|
||||
|
||||
function refreshSupervisorSrc {
|
||||
@ -121,6 +121,7 @@ function runDind {
|
||||
SUPERVISOR_IMAGE="$SUPERVISOR_IMAGE" \
|
||||
PASSWORDLESS_DROPBEAR="$PASSWORDLESS_DROPBEAR" \
|
||||
SUPERVISOR_EXTRA_MOUNTS="$SUPERVISOR_EXTRA_MOUNTS" \
|
||||
PRELOADED_IMAGE="$PRELOADED_IMAGE" \
|
||||
IMAGE="$DIND_IMAGE" \
|
||||
run-supervisor
|
||||
}
|
||||
@ -159,5 +160,6 @@ else
|
||||
;;
|
||||
*)
|
||||
showHelp
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
@ -8,7 +8,7 @@ Before=openvpn-resin.service
|
||||
WorkingDirectory=/usr/src/app
|
||||
EnvironmentFile=/usr/src/app/config/env
|
||||
EnvironmentFile=/usr/src/app/config/localenv
|
||||
ExecStartPre=/bin/bash -c 'if [ "${PRELOADED_IMAGE}" == "true" ]; then /usr/bin/docker pull $(jq ".[0].imageId" ${APPS_PATH}); fi'
|
||||
ExecStartPre=/bin/bash -c 'if [ "${PRELOADED_IMAGE}" == "true" ]; then /usr/bin/docker pull $(jq --raw-output ".[0].imageId" ${APPS_PATH}); fi'
|
||||
ExecStartPre=/usr/bin/docker load --input /usr/src/supervisor-image.tar
|
||||
ExecStartPre=-/usr/bin/docker kill resin_supervisor
|
||||
ExecStartPre=-/usr/bin/docker rm resin_supervisor
|
||||
|
Loading…
x
Reference in New Issue
Block a user