Windows: Fix 'isolation'
Signed-off-by: John Howard <jhoward@microsoft.com> Upstream-commit: d4b0732499feac87cf7c433b9490a4e21e94fb45 Component: engine
This commit is contained in:
@ -53,7 +53,7 @@ type Command struct {
|
||||
Hostname string `json:"hostname"` // Windows sets the hostname in the execdriver
|
||||
LayerFolder string `json:"layer_folder"` // Layer folder for a command
|
||||
LayerPaths []string `json:"layer_paths"` // Layer paths for a command
|
||||
Isolation string `json:"isolation"` // Isolation level for the container
|
||||
Isolation string `json:"isolation"` // Isolation technology for the container
|
||||
ArgsEscaped bool `json:"args_escaped"` // True if args are already escaped
|
||||
HvPartition bool `json:"hv_partition"` // True if it's an hypervisor partition
|
||||
}
|
||||
|
||||
@ -28,11 +28,11 @@ var dummyMode bool
|
||||
// This allows the daemon to force kill (HCS terminate) rather than shutdown
|
||||
var forceKill bool
|
||||
|
||||
// DefaultIsolation allows users to specify a default isolation mode for
|
||||
// DefaultIsolation allows users to specify a default isolation technology for
|
||||
// when running a container on Windows. For example docker daemon -D
|
||||
// --exec-opt isolation=hyperv will cause Windows to always run containers
|
||||
// as Hyper-V containers unless otherwise specified.
|
||||
var DefaultIsolation container.IsolationLevel = "process"
|
||||
var DefaultIsolation container.Isolation = "process"
|
||||
|
||||
// Define name and version for windows
|
||||
var (
|
||||
@ -83,13 +83,13 @@ func NewDriver(root string, options []string) (*Driver, error) {
|
||||
}
|
||||
|
||||
case "isolation":
|
||||
if !container.IsolationLevel(val).IsValid() {
|
||||
if !container.Isolation(val).IsValid() {
|
||||
return nil, fmt.Errorf("Unrecognised exec driver option 'isolation':'%s'", val)
|
||||
}
|
||||
if container.IsolationLevel(val).IsHyperV() {
|
||||
if container.Isolation(val).IsHyperV() {
|
||||
DefaultIsolation = "hyperv"
|
||||
}
|
||||
logrus.Infof("Windows default isolation level: '%s'", val)
|
||||
logrus.Infof("Windows default isolation: '%s'", val)
|
||||
default:
|
||||
return nil, fmt.Errorf("Unrecognised exec driver option %s\n", key)
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ func includeContainerInList(container *container.Container, ctx *listContext) it
|
||||
return excludeContainer
|
||||
}
|
||||
|
||||
// Do not include container if the isolation mode doesn't match
|
||||
// Do not include container if isolation doesn't match
|
||||
if excludeContainer == excludeByIsolation(container, ctx) {
|
||||
return excludeContainer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user