Don't dereference HostConfig.MemorySwapiness if nil

Signed-off-by: Darren Shepherd <darren@rancher.com>
Upstream-commit: 5ac12c418f163a49ad3355506fc8ed632905dbd9
Component: engine
This commit is contained in:
Darren Shepherd
2015-12-09 13:11:41 -07:00
parent e5a75c852e
commit 19d19aefcd

View File

@ -199,7 +199,11 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
BlkioThrottleReadBpsDevice: readBpsDevice,
BlkioThrottleWriteBpsDevice: writeBpsDevice,
OomKillDisable: c.HostConfig.OomKillDisable,
MemorySwappiness: *c.HostConfig.MemorySwappiness,
MemorySwappiness: -1,
}
if c.HostConfig.MemorySwappiness != nil {
resources.MemorySwappiness = *c.HostConfig.MemorySwappiness
}
processConfig := execdriver.ProcessConfig{