Conversation
Unconditional wait-for-it.sh on an unset $WAIT_TARGET printed a usage error and exited 1 under set -e, so the fresh/alpine image could not start at all unless both variables were provided. Skip the wait when WAIT_TARGET is empty and default the timeout to 30s.
sleep $SLEEP with $SLEEP unset failed with "missing operand" under set -e, aborting the stable/debian entrypoint on every default start. Default to 0 (no wait) and only sleep when a positive value is given.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found during the org-wide audit of WikiTeq/docker-varnish.
SLOP-343 —
fresh/alpineimage cannot start by defaultfresh/alpine/scripts/docker-varnish-entrypoint.shranwait-for-it.sh -t $WAIT_TIMEOUT "$WAIT_TARGET"unconditionally with both variables unset (noENV, no defaults, no documentation). Underset -e,wait-for-it.shprints a usage error and exits 1, so the container dies beforevarnishdlaunches.Verified empirically (
alpine:3.15+ this repo'swait-for-it.sh; exit codes viadocker inspect):WAIT_TARGETset + reachable: worksWAIT_TARGETset + unreachable: busyboxtimeoutSIGTERMs the probe loop, container exits 143Fix: skip the wait when
WAIT_TARGETis empty (restores upstream behavior), defaultWAIT_TIMEOUTto 30, quote expansions.SLOP-344 —
stable/debianimage cannot start by defaultstable/debian/scripts/docker-varnish-entrypointadded an unconditionalsleep $SLEEPunderset -e. With$SLEEPunset,sleep: missing operandexits 1 and the entrypoint aborts beforevarnishd.Verified:
/bin/sh -c 'set -e; sleep $SLEEP; echo REACHED'exits 1; withSLEEP=0it proceeds.Fix:
SLEEP="${SLEEP:-0}", sleep only when positive. Behavior for operators already settingSLEEP=nis unchanged.Both regressions are WikiTeq-specific delta commits from 2023-03-05; upstream
varnish/docker-varnishhas neither construct, and no other variant in this repo is affected.Verification
bash -n/sh -nclean on both scripts;shellcheckclean on the alpine entrypointWAIT_TARGETset still performs the wait and blocks on an unreachable target