Skip to content

feat: accept long-form volume nested option maps#73

Merged
lesnik512 merged 5 commits into
mainfrom
volumes-nested-options
Jul 17, 2026
Merged

feat: accept long-form volume nested option maps#73
lesnik512 merged 5 commits into
mainfrom
volumes-nested-options

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Accepts the long-form volume nested option maps (bind:/volume:/tmpfs:) for the options podman --mount can express, matching docker compose config v5.1.2. Closes the remaining long-form volumes parser gap.

Design: planning/changes/2026-07-17.02-volumes-nested-options.md.

What changed

  • Supported (the matching sub-map): bind: {propagation, selinux}bind-propagation=, relabel=shared(z)/private(Z); volume: {subpath}subpath=; tmpfs: {size, mode}tmpfs-size=/tmpfs-mode=. propagation is narrowed to podman's 6-value enum; tmpfs.size/tmpfs.mode are non-negative (mode a non-negative integer — rejecting a float that podman's crun can't mount).
  • Refused (rule-two, podman can't express): bind.create_host_path, volume.nocopy. A sub-map not matching the entry's type is refused (a deliberate stricter-than-Docker check — Docker accepts-and-ignores a mismatched sub-map).

Verification

  • 1395 tests @ 100% coverage; just lint-ci, just check-planning clean.
  • Conformance: a bind: {propagation} corpus doc flips over-reject → conformant (dedicated both-accept assertion).
  • Integration test passed on real podman 6.0.1 (a bind mount with bind-propagation round-trips a host file) — proving the --mount value with nested options is well-formed end-to-end.
  • Every emitted option spelling was measured against podman 6.0.1; the final review re-verified all six bind-propagation values, the relabel z/Z direction, and caught two tmpfs.size/mode sign/type defects (negative → false green; float mode → runtime-fails on podman) that are fixed here.

🤖 Generated with Claude Code

docker compose config rejects a negative native tmpfs size or mode
(unsigned fields), but validate_size/validate_native_number let both
through -- a hard-rule false green. A float mode was also accepted
and emitted verbatim: docker round-trips it, but podman's crun fails
to mount it at run time ("Invalid argument"). Tighten
_validate_tmpfs_options to require a non-negative native size and a
non-negative native integer mode.
@lesnik512
lesnik512 merged commit 80cebdc into main Jul 17, 2026
8 checks passed
@lesnik512
lesnik512 deleted the volumes-nested-options branch July 17, 2026 10:08
lesnik512 added a commit that referenced this pull request Jul 17, 2026
… runtime (#74)

Measured follow-up to #73: docker compose config v5.1.2 ACCEPTS a negative native number on every
top-level numeric key (mem_limit/cpus/cpu_shares/oom_score_adj/ulimits/...), deferring it to runtime
as compose2pod does -- both-accept, no false green. Only the tmpfs mount sub-schema is config-unsigned
(closed in #73). No behavior change; records the measurement as a decision so it is not re-investigated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant