github.com/sams1990/dockerrepo@v17.12.1-ce-rc2+incompatible/daemon/archive_windows.go (about)

     1  package daemon
     2  
     3  import (
     4  	"errors"
     5  
     6  	containertypes "github.com/docker/docker/api/types/container"
     7  	"github.com/docker/docker/container"
     8  )
     9  
    10  // checkIfPathIsInAVolume checks if the path is in a volume. If it is, it
    11  // cannot be in a read-only volume. If it  is not in a volume, the container
    12  // cannot be configured with a read-only rootfs.
    13  //
    14  // This is a no-op on Windows which does not support read-only volumes, or
    15  // extracting to a mount point inside a volume. TODO Windows: FIXME Post-TP5
    16  func checkIfPathIsInAVolume(container *container.Container, absPath string) (bool, error) {
    17  	return false, nil
    18  }
    19  
    20  // isOnlineFSOperationPermitted returns an error if an online filesystem operation
    21  // is not permitted (such as stat or for copying). Running Hyper-V containers
    22  // cannot have their file-system interrogated from the host as the filter is
    23  // loaded inside the utility VM, not the host.
    24  // IMPORTANT: The container lock must NOT be held when calling this function.
    25  func (daemon *Daemon) isOnlineFSOperationPermitted(container *container.Container) error {
    26  	if !container.IsRunning() {
    27  		return nil
    28  	}
    29  
    30  	// Determine isolation. If not specified in the hostconfig, use daemon default.
    31  	actualIsolation := container.HostConfig.Isolation
    32  	if containertypes.Isolation.IsDefault(containertypes.Isolation(actualIsolation)) {
    33  		actualIsolation = daemon.defaultIsolation
    34  	}
    35  	if containertypes.Isolation.IsHyperV(actualIsolation) {
    36  		return errors.New("filesystem operations against a running Hyper-V container are not supported")
    37  	}
    38  	return nil
    39  }