Skip to content

Fix tmpfs mount source field left empty for --mount type=tmpfs - #2138

Open
sivasath16 wants to merge 1 commit into
apple:mainfrom
sivasath16:fix-tmpfs-mount-source-2109
Open

Fix tmpfs mount source field left empty for --mount type=tmpfs#2138
sivasath16 wants to merge 1 commit into
apple:mainfrom
sivasath16:fix-tmpfs-mount-source-2109

Conversation

@sivasath16

Copy link
Copy Markdown

Important

All commits must be signed and verified. Pull requests containing unsigned or unverified commits cannot be built or merged. See the GitHub documentation for instructions.

For all but trivial fixes, make sure to first create a GitHub issue that concisely describes the bug or desired enhancement as justification for the change. Large PRs with no justifying issue will be closed.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Fixes #2109.

Filesystem.source is left empty when a tmpfs mount is created via --mount type=tmpfs,..., which corrupts its entry in
/proc/mounts and breaks df (df: tmpfs: No such file or directory) and mount, both of which parse that line positionally.

Parser.mount() sets Filesystem.type for type=tmpfs but never sets Filesystem.source. The --tmpfs flag doesn't have this problem because it builds its Filesystem via Filesystem.tmpfs(), which already hardcodes source: "tmpfs".

This sets source the same way in Parser.mount(), so both paths agree.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Before / after

Added testRunCommandMountTmpfs, which runs a real container with --mount type=tmpfs,... and checks df and /proc/mounts.

Before the fix:
image
✘ Test testRunCommandMountTmpfs() failed after 2.168 seconds with 1 issue.

After the fix:
image
✔ Test testRunCommandMountTmpfs() passed after 2.124 seconds.

Also ran the full targeted suites on the final diff:

  • swift test --filter ParserTest — 138/138 passed
  • CONTAINER_CLI_PATH=$(pwd)/bin/container swift test --filter TestCLIRunCommand — 33/33 passed

@sivasath16

Copy link
Copy Markdown
Author

Hi @egernst, this is ready for review. I added the fix for #2109 along with parser regression coverage and an integration test that reproduces the df failure before the fix and passes after it.

I also included the before/after results in the PR description as requested.

Thanks!

@rupinajay

Copy link
Copy Markdown

LGTM

@sivasath16
sivasath16 force-pushed the fix-tmpfs-mount-source-2109 branch from ab05ec3 to 8559e7c Compare August 19, 2026 17:19
@sivasath16

sivasath16 commented Aug 24, 2026

Copy link
Copy Markdown
Author

Hi @egernst ! When you get a chance, could you please review this? Thank you!

@egernst

egernst commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@sivasath16
sivasath16 force-pushed the fix-tmpfs-mount-source-2109 branch from 8559e7c to ab05ec3 Compare August 24, 2026 20:28
@sivasath16

Copy link
Copy Markdown
Author

Hi @egernst, Signed the commit. Thanks!

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.

[Bug]: --mount type=tmpfs creates a mount with an empty source field, breaking df and mount

3 participants