Merge pull request #13112 from hqhq/hq_fix_oonkilldisable

Fix oom kill disable issue
Upstream-commit: feb0fa8dbf9d14894d65943325c9e64a19cd2ae2
Component: engine
This commit is contained in:
Brian Goff
2015-05-13 20:03:33 -04:00
2 changed files with 4 additions and 5 deletions

View File

@ -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) {

View File

@ -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
}