From 694a7e44c5e44cfbce83432d5596f5e6b8bfa9b0 Mon Sep 17 00:00:00 2001 From: John Howard Date: Tue, 27 Sep 2016 14:52:49 -0700 Subject: [PATCH] Windows: Set correct root path logic Signed-off-by: John Howard Upstream-commit: 8f76a1d08b644008fb088b70437e91bea8cc14a9 Component: engine --- components/engine/daemon/oci_windows.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/components/engine/daemon/oci_windows.go b/components/engine/daemon/oci_windows.go index 4f2947cf79..f055783dbf 100644 --- a/components/engine/daemon/oci_windows.go +++ b/components/engine/daemon/oci_windows.go @@ -65,9 +65,19 @@ func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e s.Process.Terminal = c.Config.Tty s.Process.User.Username = c.Config.User - // In spec.Root - s.Root.Path = c.BaseFS - s.Root.Readonly = c.HostConfig.ReadonlyRootfs + // In spec.Root. This is not set for Hyper-V containers + isHyperV := false + if c.HostConfig.Isolation.IsDefault() { + // Container using default isolation, so take the default from the daemon configuration + isHyperV = daemon.defaultIsolation.IsHyperV() + } else { + // Container may be requesting an explicit isolation mode. + isHyperV = c.HostConfig.Isolation.IsHyperV() + } + if !isHyperV { + s.Root.Path = c.BaseFS + } + s.Root.Readonly = false // Windows does not support a read-only root filesystem // In s.Windows.Resources // @darrenstahlmsft implement these resources