diff --git a/daemon/exec_windows.go b/daemon/exec_windows.go index be25d20007..a6ac1db42d 100644 --- a/daemon/exec_windows.go +++ b/daemon/exec_windows.go @@ -8,7 +8,6 @@ import ( func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error { // Process arguments need to be escaped before sending to OCI. - // TODO (jstarks): escape the entrypoint too once the tests are fixed to not rely on this behavior - p.Args = append([]string{p.Args[0]}, escapeArgs(p.Args[1:])...) + p.Args = escapeArgs(p.Args) return nil } diff --git a/daemon/oci_windows.go b/daemon/oci_windows.go index 5bf3f82418..06eb7f5b4d 100644 --- a/daemon/oci_windows.go +++ b/daemon/oci_windows.go @@ -63,11 +63,9 @@ func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e } // In s.Process - if c.Config.ArgsEscaped { - s.Process.Args = append([]string{c.Path}, c.Args...) - } else { - // TODO (jstarks): escape the entrypoint too once the tests are fixed to not rely on this behavior - s.Process.Args = append([]string{c.Path}, escapeArgs(c.Args)...) + s.Process.Args = append([]string{c.Path}, c.Args...) + if !c.Config.ArgsEscaped { + s.Process.Args = escapeArgs(s.Process.Args) } s.Process.Cwd = c.Config.WorkingDir s.Process.Env = c.CreateDaemonEnvironment(linkedEnv)