1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #14691 from Microsoft/10662-start

Windows: hostconfig on start
This commit is contained in:
Antonio Murdaca 2015-07-21 00:52:19 +02:00
commit 37d737fc2c

View file

@ -2,6 +2,7 @@ package daemon
import ( import (
"fmt" "fmt"
"runtime"
"github.com/docker/docker/runconfig" "github.com/docker/docker/runconfig"
) )
@ -24,11 +25,18 @@ func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConf
return err return err
} }
// This is kept for backward compatibility - hostconfig should be passed when // Windows does not have the backwards compatibilty issue here.
// creating a container, not during start. if runtime.GOOS != "windows" {
if hostConfig != nil { // This is kept for backward compatibility - hostconfig should be passed when
if err := daemon.setHostConfig(container, hostConfig); err != nil { // creating a container, not during start.
return err if hostConfig != nil {
if err := daemon.setHostConfig(container, hostConfig); err != nil {
return err
}
}
} else {
if hostConfig != nil {
return fmt.Errorf("Supplying a hostconfig on start is not supported. It should be supplied on create")
} }
} }