mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #13112 from hqhq/hq_fix_oonkilldisable
Fix oom kill disable issue
This commit is contained in:
commit
feb0fa8dbf
2 changed files with 4 additions and 5 deletions
|
@ -24,11 +24,6 @@ func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hos
|
|||
return "", warnings, fmt.Errorf("The working directory '%s' is invalid. It needs to be an absolute path.", config.WorkingDir)
|
||||
}
|
||||
|
||||
if !daemon.SystemConfig().OomKillDisable {
|
||||
hostConfig.OomKillDisable = false
|
||||
return "", warnings, fmt.Errorf("Your kernel does not support oom kill disable.")
|
||||
}
|
||||
|
||||
container, buildWarnings, err := daemon.Create(config, hostConfig, name)
|
||||
if err != nil {
|
||||
if daemon.Graph().IsNotExist(err, config.Image) {
|
||||
|
|
|
@ -1177,6 +1177,10 @@ func (daemon *Daemon) verifyHostConfig(hostConfig *runconfig.HostConfig) ([]stri
|
|||
if hostConfig.BlkioWeight > 0 && (hostConfig.BlkioWeight < 10 || hostConfig.BlkioWeight > 1000) {
|
||||
return warnings, fmt.Errorf("Range of blkio weight is from 10 to 1000.")
|
||||
}
|
||||
if hostConfig.OomKillDisable && !daemon.SystemConfig().OomKillDisable {
|
||||
hostConfig.OomKillDisable = false
|
||||
return warnings, fmt.Errorf("Your kernel does not support oom kill disable.")
|
||||
}
|
||||
|
||||
return warnings, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue