Skip to content

Commit b0d1bc9

Browse files
Fix compose detection in puppet-stack.sh for GitHub runners
GitHub's ubuntu-latest runners ship podman but not podman-compose. The old logic hard-exited when podman was found without podman-compose. Decouple compose tool selection from engine selection so it falls through to docker compose / docker-compose, matching composeCmd() in magefile.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 02c58c7 commit b0d1bc9

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

test/puppet/puppet-stack.sh

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,19 @@ else
2929
exit 1
3030
fi
3131

32-
if [[ "$_ENGINE" == podman ]]; then
33-
if ! command -v podman-compose &>/dev/null; then
34-
printf 'Error: podman found but podman-compose not found\n' >&2
35-
exit 1
36-
fi
32+
# Resolve the compose command independently of the engine: prefer
33+
# podman-compose when running under podman and it is installed, then fall
34+
# back to docker compose / docker-compose (matches composeCmd() in magefile.go
35+
# and works on GitHub runners where podman is present but podman-compose is not).
36+
if [[ "$_ENGINE" == podman ]] && command -v podman-compose &>/dev/null; then
3737
_COMPOSE=(podman-compose -f compose-puppet.yml)
38+
elif docker compose version &>/dev/null 2>&1; then
39+
_COMPOSE=(docker compose -f compose-puppet.yml)
40+
elif command -v docker-compose &>/dev/null; then
41+
_COMPOSE=(docker-compose -f compose-puppet.yml)
3842
else
39-
if docker compose version &>/dev/null 2>&1; then
40-
_COMPOSE=(docker compose -f compose-puppet.yml)
41-
elif command -v docker-compose &>/dev/null; then
42-
_COMPOSE=(docker-compose -f compose-puppet.yml)
43-
else
44-
printf 'Error: docker found but compose unavailable\n' >&2
45-
exit 1
46-
fi
43+
printf 'Error: no compose tool found; install podman-compose or docker compose\n' >&2
44+
exit 1
4745
fi
4846

4947
# ── Configuration ─────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)