mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-11 16:15:33 -06:00
fix resource constraint specs
This commit is contained in:
parent
72c86a62c0
commit
1f739d31da
@ -44,15 +44,15 @@ func TestAccDockerContainer_customized(t *testing.T) {
|
|||||||
return fmt.Errorf("Container has wrong restart policy: %s", c.HostConfig.RestartPolicy.Name)
|
return fmt.Errorf("Container has wrong restart policy: %s", c.HostConfig.RestartPolicy.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.HostConfig.Memory != (128 * 1024 * 1024) {
|
if c.HostConfig.Memory != (512 * 1024 * 1024) {
|
||||||
return fmt.Errorf("Container has wrong memory setting: %d", c.HostConfig.Memory)
|
return fmt.Errorf("Container has wrong memory setting: %d", c.HostConfig.Memory)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.HostConfig.MemorySwap != (128 * 1024 * 1024) {
|
if c.HostConfig.MemorySwap != (2048 * 1024 * 1024) {
|
||||||
return fmt.Errorf("Container has wrong memory swap setting: %d", c.HostConfig.Memory)
|
return fmt.Errorf("Container has wrong memory swap setting: %d", c.HostConfig.MemorySwap)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.HostConfig.CPUShares != 512 {
|
if c.HostConfig.CPUShares != 32 {
|
||||||
return fmt.Errorf("Container has wrong cpu shares setting: %d", c.HostConfig.CPUShares)
|
return fmt.Errorf("Container has wrong cpu shares setting: %d", c.HostConfig.CPUShares)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,9 +143,9 @@ resource "docker_container" "foo" {
|
|||||||
entrypoint = ["/bin/bash", "-c", "ping localhost"]
|
entrypoint = ["/bin/bash", "-c", "ping localhost"]
|
||||||
restart = "on-failure"
|
restart = "on-failure"
|
||||||
max_retry_count = 5
|
max_retry_count = 5
|
||||||
memory = 128
|
memory = 512
|
||||||
memory_swap = 128
|
memory_swap = 2048
|
||||||
cpu_shares = 512
|
cpu_shares = 32
|
||||||
labels {
|
labels {
|
||||||
env = "prod"
|
env = "prod"
|
||||||
role = "test"
|
role = "test"
|
||||||
|
Loading…
Reference in New Issue
Block a user