fix(podman): kill timed container launches

This commit is contained in:
Vincent Koc
2026-05-26 17:47:25 +02:00
parent fb853de554
commit 6118f3f615
2 changed files with 7 additions and 1 deletions

View File

@@ -38,7 +38,11 @@ fail() {
run_podman_detached() {
if command -v timeout >/dev/null 2>&1; then
timeout "$PODMAN_RUN_TIMEOUT" podman run "$@"
if timeout --kill-after=1s 1s true >/dev/null 2>&1; then
timeout --kill-after=30s "$PODMAN_RUN_TIMEOUT" podman run "$@"
else
timeout "$PODMAN_RUN_TIMEOUT" podman run "$@"
fi
return
fi
podman run "$@"

View File

@@ -153,6 +153,8 @@ describe("test-install-sh-docker", () => {
expect(script).toContain('PODMAN_RUN_TIMEOUT="${OPENCLAW_PODMAN_RUN_TIMEOUT:-600s}"');
expect(script).toContain("OPENCLAW_PODMAN_RUN_TIMEOUT|OPENCLAW_PODMAN_GATEWAY_HOST_PORT");
expect(script).toContain("run_podman_detached()");
expect(script).toContain("timeout --kill-after=1s 1s true");
expect(script).toContain('timeout --kill-after=30s "$PODMAN_RUN_TIMEOUT" podman run "$@"');
expect(script).toContain('timeout "$PODMAN_RUN_TIMEOUT" podman run "$@"');
expect(script).toContain('podman run --pull="$PODMAN_PULL" --rm -it \\');
expect(script).toContain('run_podman_detached --pull="$PODMAN_PULL" -d --replace \\');