2015-07-17 00:14:58 +03:00
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
package daemon
|
|
|
|
|
2016-01-21 02:32:02 +03:00
|
|
|
import (
|
2016-04-27 05:26:12 +03:00
|
|
|
"github.com/docker/docker/container"
|
2016-01-21 02:32:02 +03:00
|
|
|
)
|
2015-11-12 22:55:17 +03:00
|
|
|
|
2015-07-17 00:14:58 +03:00
|
|
|
// 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.
|
2015-11-12 22:55:17 +03:00
|
|
|
func checkIfPathIsInAVolume(container *container.Container, absPath string) (bool, error) {
|
2015-07-17 00:14:58 +03:00
|
|
|
var toVolume bool
|
|
|
|
for _, mnt := range container.MountPoints {
|
2015-09-10 05:23:06 +03:00
|
|
|
if toVolume = mnt.HasResource(absPath); toVolume {
|
2015-07-17 00:14:58 +03:00
|
|
|
if mnt.RW {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
return false, ErrVolumeReadonly
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return toVolume, nil
|
|
|
|
}
|
2016-01-21 02:32:02 +03:00
|
|
|
|
2017-03-15 21:29:12 +03:00
|
|
|
// isOnlineFSOperationPermitted returns an error if an online filesystem operation
|
|
|
|
// is not permitted.
|
|
|
|
func (daemon *Daemon) isOnlineFSOperationPermitted(container *container.Container) error {
|
|
|
|
return nil
|
|
|
|
}
|