mirror of https://github.com/docker/cli.git
Merge pull request #4671 from thaJeztah/bind_recusrive_no_bool
mount: bind-recursive: remove boolean convenience values
This commit is contained in:
commit
8046bb2d9e
|
@ -442,10 +442,10 @@ 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>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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue