mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
Merge pull request #2342 from hashicorp/b-docker-noswap-on-win
Skip setting MemorySwap on Windows
This commit is contained in:
@@ -29,6 +29,7 @@ BUG FIXES:
|
||||
* client: Fix race condition with deriving vault tokens [GH-2275]
|
||||
* config: Fix Consul Config Merging/Copying [GH-2278]
|
||||
* config: Fix Client reserved resource merging panic [GH-2281]
|
||||
* driver/docker: Fix Docker 1.13 on Windows [GH-2342]
|
||||
* server: Fix panic when forwarding Vault derivation requests from non-leader
|
||||
servers [GH-2267]
|
||||
|
||||
|
||||
@@ -753,8 +753,7 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas
|
||||
|
||||
hostConfig := &docker.HostConfig{
|
||||
// Convert MB to bytes. This is an absolute value.
|
||||
Memory: memLimit,
|
||||
MemorySwap: memLimit, // MemorySwap is memory + swap.
|
||||
Memory: memLimit,
|
||||
// Convert Mhz to shares. This is a relative value.
|
||||
CPUShares: int64(task.Resources.CPU),
|
||||
|
||||
@@ -764,6 +763,11 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas
|
||||
Binds: binds,
|
||||
}
|
||||
|
||||
// Windows does not support MemorySwap #2193
|
||||
if runtime.GOOS != "windows" {
|
||||
hostConfig.MemorySwap = memLimit // MemorySwap is memory + swap.
|
||||
}
|
||||
|
||||
if len(driverConfig.Logging) != 0 {
|
||||
d.logger.Printf("[DEBUG] driver.docker: Using config for logging: %+v", driverConfig.Logging[0])
|
||||
hostConfig.LogConfig = docker.LogConfig{
|
||||
|
||||
Reference in New Issue
Block a user