From 09a33b5f60557ee3846baa48f5628bc6b8a70a9b Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Wed, 3 Feb 2016 04:31:00 -0500 Subject: [PATCH] Check nil before set resource.OomKillDisable Signed-off-by: Lei Jitang --- daemon/container_operations_unix.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/container_operations_unix.go b/daemon/container_operations_unix.go index d021bd0f6f..e7defa3643 100644 --- a/daemon/container_operations_unix.go +++ b/daemon/container_operations_unix.go @@ -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 }