Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cli/compose/convert/service.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -560,10 +560,6 @@ func convertResources(source composetypes.Resources) (*swarm.ResourceRequirement
GenericResources: generic,
}
}
// These fields are themselves pointers -- we can simply assign, no need to
// nil-check them. Nil is nil.
resources.SwapBytes = source.MemswapLimit
resources.MemorySwappiness = source.MemSwappiness
return resources, nil
}

Expand Down
7 changes: 0 additions & 7 deletions cli/compose/convert/service_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,9 +81,6 @@ func TestConvertExtraHosts(t *testing.T) {
}

func TestConvertResourcesFull(t *testing.T) {
// create some variables so we can get pointers
memswap := int64(72090)
swappiness := int64(27)
source := composetypes.Resources{
Limits: &composetypes.ResourceLimit{
NanoCPUs: "0.003",
Expand All@@ -93,8 +90,6 @@ func TestConvertResourcesFull(t *testing.T) {
NanoCPUs: "0.002",
MemoryBytes: composetypes.UnitBytes(200000000),
},
MemswapLimit: &memswap,
MemSwappiness: &swappiness,
}
resources, err := convertResources(source)
assert.NilError(t, err)
Expand All@@ -108,8 +103,6 @@ func TestConvertResourcesFull(t *testing.T) {
NanoCPUs: 2000000,
MemoryBytes: 200000000,
},
SwapBytes: &memswap,
MemorySwappiness: &swappiness,
}
assert.Check(t, is.DeepEqual(expected, resources))
}
Expand Down
4 changes: 1 addition & 3 deletions cli/compose/loader/full-example.yml
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
version: "3.14"
version: "3.13"

services:
foo:
Expand DownExpand Up@@ -79,8 +79,6 @@ services:
- discrete_resource_spec:
kind: 'ssd'
value: 1
memswap_limit: 86000
mem_swappiness: 27
restart_policy:
condition: on-failure
delay: 5s
Expand Down
4 changes: 1 addition & 3 deletions cli/compose/loader/full-struct_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ import (

func fullExampleConfig(workingDir, homeDir string) *types.Config {
return &types.Config{
Version: "3.14",
Version: "3.13",
Services: services(workingDir, homeDir),
Networks: networks(),
Volumes: volumes(),
Expand DownExpand Up@@ -108,8 +108,6 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
},
},
},
MemswapLimit: int64Ptr(86000),
MemSwappiness: int64Ptr(27),
},
RestartPolicy: &types.RestartPolicy{
Condition: "on-failure",
Expand Down
6 changes: 1 addition & 5 deletions cli/compose/loader/loader_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -184,7 +184,7 @@ func strPtr(val string) *string {
}

var sampleConfig = types.Config{
Version: "3.14",
Version: "3.13",
Services: []types.ServiceConfig{
{
Name: "foo",
Expand DownExpand Up@@ -970,10 +970,6 @@ func uint32Ptr(value uint32) *uint32 {
return &value
}

func int64Ptr(value int64) *int64 {
return &value
}

func TestFullExample(t *testing.T) {
skip.If(t, runtime.GOOS == "windows", "FIXME: substitutes platform-specific HOME-dirs and requires platform-specific golden files; see https://github.com/docker/cli/pull/4610")

Expand Down
6 changes: 2 additions & 4 deletions cli/compose/loader/testdata/full-example.json.golden
Original file line numberDiff line numberDiff line change
Expand Up@@ -181,9 +181,7 @@
}
}
]
},
"memswap_limit": 86000,
"mem_swappiness": 27
}
},
"restart_policy": {
"condition": "on-failure",
Expand DownExpand Up@@ -515,7 +513,7 @@
"working_dir": "/code"
}
},
"version": "3.14",
"version": "3.13",
"volumes": {
"another-volume": {
"name": "user_specified_name",
Expand Down
4 changes: 1 addition & 3 deletions cli/compose/loader/testdata/full-example.yaml.golden
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
version: "3.14"
version: "3.13"
services:
foo:
build:
Expand DownExpand Up@@ -73,8 +73,6 @@ services:
- discrete_resource_spec:
kind: ssd
value: 1
memswap_limit: 86000
mem_swappiness: 27
restart_policy:
condition: on-failure
delay: 5s
Expand Down
Loading
Loading