From 2c274217deb9003fe0debf62e740436df983d613 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 10 May 2026 21:42:35 -0400 Subject: [PATCH] chore: run shfmt --- .../etc/runit/runsvdir/default/dokku-restore/finish | 4 ++-- tests/image/healthcheck.sh | 8 ++++---- tests/unit/docker-image-healthcheck.bats | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docker/etc/runit/runsvdir/default/dokku-restore/finish b/docker/etc/runit/runsvdir/default/dokku-restore/finish index 84270a92c..39a01df0b 100755 --- a/docker/etc/runit/runsvdir/default/dokku-restore/finish +++ b/docker/etc/runit/runsvdir/default/dokku-restore/finish @@ -11,8 +11,8 @@ fi echo "Done restoring dokku apps." -while ! (echo > /dev/tcp/127.0.0.1/22) >/dev/null 2>&1; do sleep 1; done -while ! (echo > /dev/tcp/127.0.0.1/80) >/dev/null 2>&1; do sleep 1; done +while ! (echo >/dev/tcp/127.0.0.1/22) >/dev/null 2>&1; do sleep 1; done +while ! (echo >/dev/tcp/127.0.0.1/80) >/dev/null 2>&1; do sleep 1; done touch /var/run/dokku/ready echo "Dokku is ready." diff --git a/tests/image/healthcheck.sh b/tests/image/healthcheck.sh index 49f114e1a..6fb2399b4 100755 --- a/tests/image/healthcheck.sh +++ b/tests/image/healthcheck.sh @@ -38,7 +38,7 @@ start-container() { wait-for-catchall-vhost() { local deadline=$((SECONDS + 30)) - while (( SECONDS < deadline )); do + while ((SECONDS < deadline)); do if docker exec "$CONTAINER_NAME" test -f /etc/nginx/conf.d/00-default-vhost.conf; then return 0 fi @@ -53,7 +53,7 @@ plugins/nginx-vhosts/templates/default-site.conf. Rebuild the deb before running wait-for-healthy() { local deadline=$((SECONDS + START_TIMEOUT_SECONDS)) local status - while (( SECONDS < deadline )); do + while ((SECONDS < deadline)); do status=$(docker inspect --format='{{.State.Health.Status}}' "$CONTAINER_NAME" 2>/dev/null || echo "missing") if [[ "$status" == "healthy" ]]; then log-info "Container reached healthy status" @@ -95,14 +95,14 @@ assert-unhealthy-after-sentinel-removed() { local exit_code=0 docker exec "$CONTAINER_NAME" curl -fsS http://127.0.0.1:18080/_dokku/health >/dev/null 2>&1 || exit_code=$? - if (( exit_code == 0 )); then + if ((exit_code == 0)); then log-fail "Health endpoint still returned success after the readiness sentinel was removed" fi log-info "Waiting for docker to flip the health status to unhealthy" local deadline=$((SECONDS + UNHEALTHY_TIMEOUT_SECONDS)) local status - while (( SECONDS < deadline )); do + while ((SECONDS < deadline)); do status=$(docker inspect --format='{{.State.Health.Status}}' "$CONTAINER_NAME" 2>/dev/null || echo "missing") if [[ "$status" == "unhealthy" ]]; then log-info "Container flipped to unhealthy" diff --git a/tests/unit/docker-image-healthcheck.bats b/tests/unit/docker-image-healthcheck.bats index e91a65829..27d75caea 100644 --- a/tests/unit/docker-image-healthcheck.bats +++ b/tests/unit/docker-image-healthcheck.bats @@ -26,8 +26,8 @@ DOCKERFILE="${REPO_ROOT}/Dockerfile" [[ -n "$sshd_line" ]] [[ -n "$nginx_line" ]] [[ -n "$touch_line" ]] - (( touch_line > sshd_line )) - (( touch_line > nginx_line )) + ((touch_line > sshd_line)) + ((touch_line > nginx_line)) } @test "(docker-image) [healthcheck] my_init clears stale sentinel on container boot" { @@ -43,10 +43,10 @@ DOCKERFILE="${REPO_ROOT}/Dockerfile" [[ -n "$mkdir_line" ]] [[ -n "$plugin_line" ]] [[ -n "$hostname_line" ]] - (( rm_line < plugin_line )) - (( rm_line < hostname_line )) - (( mkdir_line < plugin_line )) - (( mkdir_line < hostname_line )) + ((rm_line < plugin_line)) + ((rm_line < hostname_line)) + ((mkdir_line < plugin_line)) + ((mkdir_line < hostname_line)) } @test "(docker-image) [healthcheck] Dockerfile declares HEALTHCHECK with the expected endpoint" {