2015-07-16 21:14:58 +00:00
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
package daemon
|
|
|
|
|
|
|
|
// checkIfPathIsInAVolume checks if the path is in a volume. If it is, it
|
|
|
|
// cannot be in a read-only volume. If it is not in a volume, the container
|
|
|
|
// cannot be configured with a read-only rootfs.
|
|
|
|
func checkIfPathIsInAVolume(container *Container, absPath string) (bool, error) {
|
|
|
|
var toVolume bool
|
|
|
|
for _, mnt := range container.MountPoints {
|
2015-09-10 02:23:06 +00:00
|
|
|
if toVolume = mnt.HasResource(absPath); toVolume {
|
2015-07-16 21:14:58 +00:00
|
|
|
if mnt.RW {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
return false, ErrVolumeReadonly
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return toVolume, nil
|
|
|
|
}
|