mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Check nil before set resource.OomKillDisable
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
parent
fa0856e0e4
commit
6f72190b7d
1 changed files with 3 additions and 1 deletions
|
@ -208,10 +208,12 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
|
|||
BlkioThrottleWriteBpsDevice: writeBpsDevice,
|
||||
BlkioThrottleReadIOpsDevice: readIOpsDevice,
|
||||
BlkioThrottleWriteIOpsDevice: writeIOpsDevice,
|
||||
OomKillDisable: *c.HostConfig.OomKillDisable,
|
||||
MemorySwappiness: -1,
|
||||
}
|
||||
|
||||
if c.HostConfig.OomKillDisable != nil {
|
||||
resources.OomKillDisable = *c.HostConfig.OomKillDisable
|
||||
}
|
||||
if c.HostConfig.MemorySwappiness != nil {
|
||||
resources.MemorySwappiness = *c.HostConfig.MemorySwappiness
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue