Przeglądaj źródła

Merge pull request #19961 from coolljt0725/check_nil

1.10.0-rc3: Check nil before set resource.OomKillDisable
Sebastiaan van Stijn 9 lat temu
rodzic
commit
f37e10aee3
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      daemon/container_operations_unix.go

+ 3 - 1
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
 	}