From f183590cf4a45c04e7c891ef6089fd2463690c07 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Mon, 21 Dec 2015 14:50:54 +0000 Subject: [PATCH] [probe] Only target scope.weave.works implicitly if no app is provided --- docker/entrypoint.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 313bafadc..a58e0f5bf 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -67,6 +67,7 @@ weave_expose() { mkdir -p /etc/weave APP_ARGS="" PROBE_ARGS="" +TOKEN_PROVIDED=false if [ "$1" = version ]; then /home/weave/scope version @@ -108,7 +109,7 @@ while true; do shift fi PROBE_ARGS="$PROBE_ARGS -token=$ARG_VALUE" - echo "scope.weave.works:443" >/etc/weave/apps + TOKEN_PROVIDED=true touch /etc/service/app/down ;; --no-app) @@ -157,7 +158,15 @@ echo "$PROBE_ARGS" >/etc/weave/scope-probe.args # using Weave DNS. We stick these in /etc/weave/apps # for the run-probe script to pick up. MANUAL_APPS=$@ + +# Implicitly target the Scope Service if a service token was provided with +# no explicit manual app. +if [ "$MANUAL_APPS" = "" -a "$TOKEN_PROVIDED" = "true" ]; then + MANUAL_APPS="scope.weave.works:443" +fi + echo "$MANUAL_APPS" >>/etc/weave/apps + exec /home/weave/runsvinit