Bläddra i källkod

Merge pull request #18550 from ibuildthecloud/panic

Don't dereference HostConfig.MemorySwapiness if nil
Brian Goff 9 år sedan
förälder
incheckning
ff0e33824a
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      daemon/container_operations_unix.go

+ 5 - 1
daemon/container_operations_unix.go

@@ -200,7 +200,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{