Skip to content

fix(delivery): use podman unshare for rootless volume population#276

Closed
skevetter wants to merge 2 commits into
mainfrom
2a7d-20db-rootless-podman-volume
Closed

fix(delivery): use podman unshare for rootless volume population#276
skevetter wants to merge 2 commits into
mainfrom
2a7d-20db-rootless-podman-volume

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

  • Detects rootless Podman via isPodman() + isRootlessPodman() (checks podman info --format {{.Host.Security.Rootless}})
  • Routes rootless Podman volume writes through podman unshare sh -c '...' to enter the user namespace, where the volume mountpoint is accessible
  • Docker path is completely unchanged — still uses direct os.WriteFile
  • Path passed as positional argument to shell script to prevent injection
  • Adds 7 unit tests covering isPodman detection, isRootlessPodman detection, Podman unshare write path, Docker direct write path, and unshare error handling

skevetter added 2 commits May 13, 2026 14:57
populateVolumeDirectCopy writes directly to the volume mountpoint path
from `volume inspect`. Under rootless Podman, this path is inside a user
namespace and not accessible from the host filesystem, causing WriteFile
to fail.

Detect rootless Podman via `podman info --format {{.Host.Security.Rootless}}`
and route to a new populateVolumeUnshare method that pipes the binary
through `podman unshare sh -c 'cat > <path> && chmod 755 <path>'` to
write within the correct namespace. Docker path is unchanged.
Route populateVolumeUnshare through d.cmd() instead of raw
exec.CommandContext to stay consistent with all other methods and
inherit environment handling. Pass destPath as a positional argument
to the shell script to prevent breakage from special characters in
volume mountpoint paths.
@netlify

netlify Bot commented May 13, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit c5f148c
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a04da4c14dcc80008cc5e3c

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 34ec37fc-d352-4cdf-a318-fef2b5db268a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@skevetter

Copy link
Copy Markdown
Contributor Author

Closing: DEVSY-091 already merged via PR #275 (v3's branch). Duplicate PR.

@skevetter skevetter closed this May 13, 2026
@skevetter
skevetter deleted the 2a7d-20db-rootless-podman-volume branch May 17, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant