Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mount: bind-recursive: remove boolean convenience values #4671

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/reference/commandline/service_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,13 @@ The following options can only be used for bind mounts (`type=bind`):
A value is one of:<br />
<br />
<ul>
<li><<tt>enabled</tt>, <tt>true</tt> or <tt>1</tt>: Enables recursive bind-mount.
<li><<tt>enabled</tt>: Enables recursive bind-mount.
Read-only mounts are made recursively read-only if kernel is v5.12 or later.
Otherwise they are not made recursively read-only.</li>
<li><<tt>disabled</tt>, <tt>false</tt> or <tt>0</tt>: Disables recursive bind-mount.</li>
<li><<tt>writable</tt>: Enables recursive bind-mount.
<li><<tt>disabled</tt>: Disables recursive bind-mount.</li>
<li><<tt>writable</tt>: Enables recursive bind-mount.
Read-only mounts are not made recursively read-only.</li>
<li><<tt>readonly</tt>: Enables recursive bind-mount.
<li><<tt>readonly</tt>: Enables recursive bind-mount.
Read-only mounts are made recursively read-only if kernel is v5.12 or later.
Otherwise the Engine raises an error.</li>
</ul>
Expand Down
11 changes: 1 addition & 10 deletions opts/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,7 @@ func (m *MountOpt) Set(value string) error {
}
logrus.Warn("bind-nonrecursive is deprecated, use bind-recursive=disabled instead")
case "bind-recursive":
valS := val
// Allow boolean as an alias to "enabled" or "disabled"
if b, err := strconv.ParseBool(valS); err == nil {
if b {
valS = "enabled"
} else {
valS = "disabled"
}
}
switch valS {
switch val {
case "enabled": // read-only mounts are recursively read-only if Engine >= v25 && kernel >= v5.12, otherwise writable
// NOP
case "disabled": // alias of bind-nonrecursive=true
Expand Down
Loading