From f32ec0fc9e308e14707e44fc6c624118db46fd20 Mon Sep 17 00:00:00 2001 From: Samuel K <69881238+skevetter@users.noreply.github.com> Date: Sun, 27 Sep 2026 09:05:18 -0600 Subject: [PATCH 1/2] fix(e2e): prevent podman lock contention in rootful wrapper sudo drops environment variables by default, which causes the DOCKER_HOST variable to be lost. This forces the podman CLI in the test wrapper to fall back to local storage and hang while waiting for the libpod lock held by the background podman system service daemon. Using sudo -E preserves the environment so the wrapper correctly communicates over the socket. --- e2e/tests/up/podman_rootful.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/tests/up/podman_rootful.go b/e2e/tests/up/podman_rootful.go index c59f00a467..51f737863d 100644 --- a/e2e/tests/up/podman_rootful.go +++ b/e2e/tests/up/podman_rootful.go @@ -252,7 +252,7 @@ func setupRootfulPodman(ctx context.Context, initialDir string) *framework.Frame wrapper, err := os.Create(wrapperPath) //nolint:gosec // G304: test-controlled path framework.ExpectNoError(err) - _, err = wrapper.WriteString("#!/bin/sh\nsudo podman \"$@\"\n") + _, err = wrapper.WriteString("#!/bin/sh\nsudo -E podman \"$@\"\n") if err != nil { _ = wrapper.Close() } From 04ac05c80d7a0e7d7adc132627e85c6806cc6702 Mon Sep 17 00:00:00 2001 From: Samuel K <69881238+skevetter@users.noreply.github.com> Date: Sun, 27 Sep 2026 09:40:51 -0600 Subject: [PATCH 2/2] fix(e2e): explicitly pass DOCKER_HOST to rootful podman wrapper This addresses security/architectural feedback by constraining the privileged invocation. Instead of passing the entire caller environment via `sudo -E`, the wrapper script explicitly passes `--remote` and `--url` only when `DOCKER_HOST` is set. --- e2e/tests/up/podman_rootful.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/e2e/tests/up/podman_rootful.go b/e2e/tests/up/podman_rootful.go index 51f737863d..97508d226c 100644 --- a/e2e/tests/up/podman_rootful.go +++ b/e2e/tests/up/podman_rootful.go @@ -252,7 +252,14 @@ func setupRootfulPodman(ctx context.Context, initialDir string) *framework.Frame wrapper, err := os.Create(wrapperPath) //nolint:gosec // G304: test-controlled path framework.ExpectNoError(err) - _, err = wrapper.WriteString("#!/bin/sh\nsudo -E podman \"$@\"\n") + script := `#!/bin/sh +if [ -n "$DOCKER_HOST" ]; then + sudo podman --remote --url "$DOCKER_HOST" "$@" +else + sudo podman "$@" +fi +` + _, err = wrapper.WriteString(script) if err != nil { _ = wrapper.Close() }