Check nil before set resource.OomKillDisable
Signed-off-by: Lei Jitang <leijitang@huawei.com> Upstream-commit: 09a33b5f60557ee3846baa48f5628bc6b8a70a9b Component: engine
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user