Skip to content

Commit 282839c

Browse files
committed
cli/compose: memswap_limit -> memory_swap, mem_swappiness -> memory_swappiness
Align the names in the compose / stack schema with the command-line flags, instead of aligning with the existing options in the compose-schema (which I think originated from v1); https://github.com/compose-spec/compose-spec/blob/a08f8d51631b7127ddac3d2c65537db429d0f1d0/spec.md?plain=1#L1440-L1461 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent ee244f2 commit 282839c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cli/compose/loader/full-example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ services:
7979
- discrete_resource_spec:
8080
kind: 'ssd'
8181
value: 1
82-
memswap_limit: 86000
83-
mem_swappiness: 27
82+
memory_swap: 86000
83+
memory_swappiness: 27
8484
restart_policy:
8585
condition: on-failure
8686
delay: 5s

cli/compose/loader/testdata/full-example.json.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@
182182
}
183183
]
184184
},
185-
"memswap_limit": 86000,
186-
"mem_swappiness": 27
185+
"memory_swap": 86000,
186+
"memory_swappiness": 27
187187
},
188188
"restart_policy": {
189189
"condition": "on-failure",

cli/compose/loader/testdata/full-example.yaml.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ services:
7373
- discrete_resource_spec:
7474
kind: ssd
7575
value: 1
76-
memswap_limit: 86000
77-
mem_swappiness: 27
76+
memory_swap: 86000
77+
memory_swappiness: 27
7878
restart_policy:
7979
condition: on-failure
8080
delay: 5s

cli/compose/schema/data/config_schema_v3.14.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,10 @@
414414
},
415415
"additionalProperties": false
416416
},
417-
"memswap_limit": {
417+
"memory_swap": {
418418
"type": "integer"
419419
},
420-
"mem_swappiness": {
420+
"memory_swappiness": {
421421
"type": "integer"
422422
}
423423
},

cli/compose/types/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var ForbiddenProperties = map[string]string{
4949
"cpu_shares": "Set resource limits using deploy.resources",
5050
"cpuset": "Set resource limits using deploy.resources",
5151
"mem_limit": "Set resource limits using deploy.resources",
52-
"memswap_limit": "Set resource limits using deploy.resources",
52+
"memory_swap": "Set resource limits using deploy.resources",
5353
}
5454

5555
// ConfigFile is a filename and the contents of the file as a Dict
@@ -309,8 +309,8 @@ type UpdateConfig struct {
309309
type Resources struct {
310310
Limits *ResourceLimit `yaml:",omitempty" json:"limits,omitempty"`
311311
Reservations *Resource `yaml:",omitempty" json:"reservations,omitempty"`
312-
MemswapLimit *int64 `mapstructure:"memswap_limit" yaml:"memswap_limit,omitempty" json:"memswap_limit,omitempty"`
313-
MemSwappiness *int64 `mapstructure:"mem_swappiness" yaml:"mem_swappiness,omitempty" json:"mem_swappiness,omitempty"`
312+
MemswapLimit *int64 `mapstructure:"memory_swap" yaml:"memory_swap,omitempty" json:"memory_swap,omitempty"`
313+
MemSwappiness *int64 `mapstructure:"memory_swappiness" yaml:"memory_swappiness,omitempty" json:"memory_swappiness,omitempty"`
314314
}
315315

316316
// ResourceLimit is a resource to be limited

0 commit comments

Comments
 (0)