mirror of
https://github.com/docker/compose.git
synced 2025-07-23 05:34:36 +02:00
memory values can be strings or numbers
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
711b0b4daf
commit
440099754d
@ -68,8 +68,18 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"mac_address": {"type": "string"},
|
"mac_address": {"type": "string"},
|
||||||
"mem_limit": {"type": "number"},
|
"mem_limit": {
|
||||||
"memswap_limit": {"type": "number"},
|
"oneOf": [
|
||||||
|
{"type": "number"},
|
||||||
|
{"type": "string"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"memswap_limit": {
|
||||||
|
"oneOf": [
|
||||||
|
{"type": "number"},
|
||||||
|
{"type": "string"}
|
||||||
|
]
|
||||||
|
},
|
||||||
"name": {"type": "string"},
|
"name": {"type": "string"},
|
||||||
"net": {"type": "string"},
|
"net": {"type": "string"},
|
||||||
"pid": {"type": "string"},
|
"pid": {"type": "string"},
|
||||||
|
@ -533,6 +533,16 @@ class MemoryOptionsTest(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(service_dict[0]['memswap_limit'], 2000000)
|
self.assertEqual(service_dict[0]['memswap_limit'], 2000000)
|
||||||
|
|
||||||
|
def test_memswap_can_be_a_string(self):
|
||||||
|
service_dict = config.load(
|
||||||
|
config.ConfigDetails(
|
||||||
|
{'foo': {'image': 'busybox', 'mem_limit': "1G", 'memswap_limit': "512M"}},
|
||||||
|
'tests/fixtures/extends',
|
||||||
|
'common.yml'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.assertEqual(service_dict[0]['memswap_limit'], "512M")
|
||||||
|
|
||||||
|
|
||||||
class EnvTest(unittest.TestCase):
|
class EnvTest(unittest.TestCase):
|
||||||
def test_parse_environment_as_list(self):
|
def test_parse_environment_as_list(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user