From a43ab6d49c455809bb2588aa36816a9aa87e97b6 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 4 Feb 2021 11:58:01 +0100 Subject: [PATCH] fix: [cron] ``dc`` command would fail in user environment On user launched ``compose`` (using ``~/.compose/sessions`` as session dir, the ``dc`` command would fail getting it's environment file correctly, and subsequently would fail running. Signed-off-by: Valentin Lab --- cron/hooks/init | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cron/hooks/init b/cron/hooks/init index 69a9633a..9bb74100 100755 --- a/cron/hooks/init +++ b/cron/hooks/init @@ -19,6 +19,12 @@ fi exit 1 } +[ "$HOST_COMPOSE_LAUNCHER_OPTS" ] || { + err "\$HOST_COMPOSE_LAUNCHER_OPTS is expected to be set." + exit 1 +} + + [ "$COMPOSE_LAUNCHER_BIN" ] || { err "\$COMPOSE_LAUNCHER_BIN is expected to be set." exit 1 @@ -31,7 +37,7 @@ $CHARM_NAME: - /etc/timezone:/etc/timezone:ro - \$DOCKER_COMPOSE_PATH/bin/dc:/bin/dc:ro - $COMPOSE_LAUNCHER_BIN:/bin/compose:ro - - $COMPOSE_LAUNCHER_OPTS:$COMPOSE_LAUNCHER_OPTS:ro + - $HOST_COMPOSE_LAUNCHER_OPTS:$COMPOSE_LAUNCHER_OPTS:ro environment: TZ: $timezone COMPOSE_LAUNCHER_OPTS: $COMPOSE_LAUNCHER_OPTS