mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #18561 from hqhq/hq_adapt_at_start
Adapt container settings when start
This commit is contained in:
commit
1ca6690b4f
1 changed files with 5 additions and 3 deletions
|
@ -30,9 +30,6 @@ func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConf
|
||||||
// creating a container, not during start.
|
// creating a container, not during start.
|
||||||
if hostConfig != nil {
|
if hostConfig != nil {
|
||||||
logrus.Warn("DEPRECATED: Setting host configuration options when the container starts is deprecated and will be removed in Docker 1.12")
|
logrus.Warn("DEPRECATED: Setting host configuration options when the container starts is deprecated and will be removed in Docker 1.12")
|
||||||
if err := daemon.adaptContainerSettings(hostConfig, false); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := daemon.setHostConfig(container, hostConfig); err != nil {
|
if err := daemon.setHostConfig(container, hostConfig); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -49,6 +46,11 @@ func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConf
|
||||||
if _, err = daemon.verifyContainerSettings(container.HostConfig, nil); err != nil {
|
if _, err = daemon.verifyContainerSettings(container.HostConfig, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// Adapt for old containers in case we have updates in this function and
|
||||||
|
// old containers never have chance to call the new function in create stage.
|
||||||
|
if err := daemon.adaptContainerSettings(container.HostConfig, false); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return daemon.containerStart(container)
|
return daemon.containerStart(container)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue