Skip to content

Parse a boolean value for the readonly mount option - #2515

Open
0z5a wants to merge 1 commit into
apple:mainfrom
0z5a:fix/mount-readonly-value
Open

0z5a wants to merge 1 commit into
apple:mainfrom
0z5a:fix/mount-readonly-value

Conversation

@0z5a

@0z5a 0z5a commented Nov 13, 2026

Copy link
Copy Markdown

Fixes #2514

--mount ...,readonly=false (or ro=0) produced a read-only mount, because Parser.mount ignored the value of readonly/ro. This change accepts true/false/1/0 like docker --mount and keeps the bare key meaning true. Any other value is rejected with an error.

The value check sits in the readonly/ro case of the directive switch. That removes the skipValue flag; every other key still requires key=value. docs/volumes.md is updated.

Test: ParserTest.testMountReadonlyValue covers the bare keys, =true/=1, =false/=0, and an invalid value. On main it fails for readonly=false, ro=0 and the invalid value. With this change, swift test --filter ParserTest passes all 163 tests (macOS 26.6.1, Swift 6.3.3).

This change was drafted with Claude Code (claude-opus-5-5); the test results above are from the runs described.

`--mount ...,readonly=false` (or `ro=0`) produced a read-only mount
because the value of `readonly`/`ro` was ignored. Accept true/false/1/0
like `docker --mount`, keep the bare key meaning true, and reject any
other value.

This branch has not been deployed

No deployments
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 ...,readonly=false creates a read-only mount

1 participant