Windows: Split ContainerExecCreate

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e35b025aa61e7d8db04a9973967b7109f742593a
Component: engine
This commit is contained in:
jhowardmsft
2015-05-06 16:19:27 -07:00
committed by John Howard
parent 11e5be135f
commit 8b7803021e
3 changed files with 30 additions and 3 deletions
+3 -3
View File
@@ -9,7 +9,6 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/daemon/execdriver"
"github.com/docker/docker/daemon/execdriver/lxc"
"github.com/docker/docker/pkg/broadcastwriter"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/stringid"
@@ -111,8 +110,9 @@ func (d *Daemon) getActiveContainer(name string) (*Container, error) {
func (d *Daemon) ContainerExecCreate(config *runconfig.ExecConfig) (string, error) {
if strings.HasPrefix(d.execDriver.Name(), lxc.DriverName) {
return "", lxc.ErrExec
// Not all drivers support Exec (LXC for example)
if err := checkExecSupport(d.execDriver.Name()); err != nil {
return "", err
}
container, err := d.getActiveContainer(config.Container)
+18
View File
@@ -0,0 +1,18 @@
// +build linux
package daemon
import (
"strings"
"github.com/docker/docker/daemon/execdriver/lxc"
)
// checkExecSupport returns an error if the exec driver does not support exec,
// or nil if it is supported.
func checkExecSupport(drivername string) error {
if strings.HasPrefix(drivername, lxc.DriverName) {
return lxc.ErrExec
}
return nil
}
+9
View File
@@ -0,0 +1,9 @@
// +build windows
package daemon
// checkExecSupport returns an error if the exec driver does not support exec,
// or nil if it is supported.
func checkExecSupport(DriverName string) error {
return nil
}