From dad20b0a43933c9e2465a5876f4d5ac6d6b292cd Mon Sep 17 00:00:00 2001 From: casjay Date: Fri, 19 Jun 2026 23:14:44 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20three=20entrypoint=20bugs?= =?UTF-8?q?=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CONTAINER_NAME was hardcoded to "alpine" instead of "go"; the startup message said "alpine" for the same reason - HEALTH_ENABLED was hard-assigned to "yes" after env files were sourced, silently overriding the HEALTH_ENABLED="no" set in env/go.sh; changed to ${HEALTH_ENABLED:-yes} so the env file value is respected - go-workflow used retval (lowercase) to capture the go vet exit code but then read retVal (uppercase) in the accumulator; the vet failure was silently dropped and the gofmt exit code was summed twice instead - rootfs/usr/local/bin/entrypoint.sh: fix CONTAINER_NAME default, startup message label, and HEALTH_ENABLED hard-override - rootfs/usr/local/bin/go-workflow: fix retval/retVal case mismatch so go vet exit code is correctly propagated rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/bin/go-workflow --- rootfs/usr/local/bin/entrypoint.sh | 6 +++--- rootfs/usr/local/bin/go-workflow | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rootfs/usr/local/bin/entrypoint.sh b/rootfs/usr/local/bin/entrypoint.sh index 62037d8..6782e85 100755 --- a/rootfs/usr/local/bin/entrypoint.sh +++ b/rootfs/usr/local/bin/entrypoint.sh @@ -39,7 +39,7 @@ PATH="/usr/local/etc/docker/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin" # - - - - - - - - - - - - - - - - - - - - - - - - - # Set bash options SCRIPT_FILE="$0" -CONTAINER_NAME="alpine" +CONTAINER_NAME="go" SCRIPT_NAME="${SCRIPT_FILE##*/}" CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}" # - - - - - - - - - - - - - - - - - - - - - - - - - @@ -108,7 +108,7 @@ WEB_SERVER_PORT="" # - - - - - - - - - - - - - - - - - - - - - - - - - # Healthcheck variables # enable healthcheck [yes/no] -HEALTH_ENABLED="yes" +HEALTH_ENABLED="${HEALTH_ENABLED:-yes}" # comma separated list of processes for the healthcheck SERVICES_LIST="tini" # url endpoints: [http://localhost/health,http://localhost/test] @@ -294,7 +294,7 @@ fi if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then if [ "$ENTRYPOINT_MESSAGE" = "yes" ]; then - echo "Executing entrypoint script for alpine" + echo "Executing entrypoint script for go" fi fi # - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/bin/go-workflow b/rootfs/usr/local/bin/go-workflow index 7779c53..18976fd 100755 --- a/rootfs/usr/local/bin/go-workflow +++ b/rootfs/usr/local/bin/go-workflow @@ -43,7 +43,7 @@ retVal=$? GO_EXITCODE=$((GO_EXITCODE + retVal)) # 3. Catch suspicious constructs run_step "go vet ./..." go vet ./... -retval=$? +retVal=$? GO_EXITCODE=$((GO_EXITCODE + retVal)) # 4. Run tests — fail fast before wasting time on a build run_step "go test ./..." go test ./...