mirror of https://github.com/docker/docs.git
Merge pull request #12663 from Mashimiao/Move-setHostConfig-to-daemon-file
Move setHostConfig to daemon file
This commit is contained in:
commit
d59ce5cd48
|
@ -1248,3 +1248,21 @@ func (daemon *Daemon) verifyHostConfig(hostConfig *runconfig.HostConfig) ([]stri
|
||||||
|
|
||||||
return warnings, nil
|
return warnings, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.HostConfig) error {
|
||||||
|
container.Lock()
|
||||||
|
defer container.Unlock()
|
||||||
|
if err := parseSecurityOpt(container, hostConfig); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register any links from the host config before starting the container
|
||||||
|
if err := daemon.RegisterLinks(container, hostConfig); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
container.hostConfig = hostConfig
|
||||||
|
container.toDisk()
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -39,21 +39,3 @@ func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConf
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.HostConfig) error {
|
|
||||||
container.Lock()
|
|
||||||
defer container.Unlock()
|
|
||||||
if err := parseSecurityOpt(container, hostConfig); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register any links from the host config before starting the container
|
|
||||||
if err := daemon.RegisterLinks(container, hostConfig); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
container.hostConfig = hostConfig
|
|
||||||
container.toDisk()
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue