Skip to content

Commit 8046bb2

Browse files
authored
Merge pull request #4671 from thaJeztah/bind_recusrive_no_bool
mount: bind-recursive: remove boolean convenience values
2 parents 1401f91 + 7be05a6 commit 8046bb2

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

docs/reference/commandline/service_create.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,13 @@ The following options can only be used for bind mounts (`type=bind`):
442442
A value is one of:<br />
443443
<br />
444444
<ul>
445-
<li><<tt>enabled</tt>, <tt>true</tt> or <tt>1</tt>: Enables recursive bind-mount.
445+
<li><<tt>enabled</tt>: Enables recursive bind-mount.
446446
Read-only mounts are made recursively read-only if kernel is v5.12 or later.
447447
Otherwise they are not made recursively read-only.</li>
448-
<li><<tt>disabled</tt>, <tt>false</tt> or <tt>0</tt>: Disables recursive bind-mount.</li>
449-
<li><<tt>writable</tt>: Enables recursive bind-mount.
448+
<li><<tt>disabled</tt>: Disables recursive bind-mount.</li>
449+
<li><<tt>writable</tt>: Enables recursive bind-mount.
450450
Read-only mounts are not made recursively read-only.</li>
451-
<li><<tt>readonly</tt>: Enables recursive bind-mount.
451+
<li><<tt>readonly</tt>: Enables recursive bind-mount.
452452
Read-only mounts are made recursively read-only if kernel is v5.12 or later.
453453
Otherwise the Engine raises an error.</li>
454454
</ul>

opts/mount.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,7 @@ func (m *MountOpt) Set(value string) error {
116116
}
117117
logrus.Warn("bind-nonrecursive is deprecated, use bind-recursive=disabled instead")
118118
case "bind-recursive":
119-
valS := val
120-
// Allow boolean as an alias to "enabled" or "disabled"
121-
if b, err := strconv.ParseBool(valS); err == nil {
122-
if b {
123-
valS = "enabled"
124-
} else {
125-
valS = "disabled"
126-
}
127-
}
128-
switch valS {
119+
switch val {
129120
case "enabled": // read-only mounts are recursively read-only if Engine >= v25 && kernel >= v5.12, otherwise writable
130121
// NOP
131122
case "disabled": // alias of bind-nonrecursive=true

0 commit comments

Comments
 (0)