mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #14639 from calavera/fix_read_write_check
Fix read-write check for volumes.
This commit is contained in:
commit
8c7cd78650
2 changed files with 6 additions and 1 deletions
|
@ -172,7 +172,7 @@ func (daemon *Daemon) registerMountPoints(container *Container, hostConfig *runc
|
||||||
cp := &mountPoint{
|
cp := &mountPoint{
|
||||||
Name: m.Name,
|
Name: m.Name,
|
||||||
Source: m.Source,
|
Source: m.Source,
|
||||||
RW: m.RW && !roModes[mode],
|
RW: m.RW && volume.ReadWrite(mode),
|
||||||
Driver: m.Driver,
|
Driver: m.Driver,
|
||||||
Destination: m.Destination,
|
Destination: m.Destination,
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,3 +50,8 @@ var roModes = map[string]bool{
|
||||||
func ValidateMountMode(mode string) (bool, bool) {
|
func ValidateMountMode(mode string) (bool, bool) {
|
||||||
return roModes[mode] || rwModes[mode], rwModes[mode]
|
return roModes[mode] || rwModes[mode], rwModes[mode]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReadOnly tells you if a mode string is a valid read-only mode or not.
|
||||||
|
func ReadWrite(mode string) bool {
|
||||||
|
return rwModes[mode]
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue