mirror of
https://github.com/docker/compose.git
synced 2025-07-12 16:24:32 +02:00
driver_opts can only be of type string
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
e1d67ad68a
commit
a8fda480e3
@ -78,7 +78,7 @@
|
|||||||
"driver_opts": {
|
"driver_opts": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"patternProperties": {
|
"patternProperties": {
|
||||||
"^.+$": {"type": ["string", "number"]}
|
"^.+$": {"type": "string"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"external": {
|
"external": {
|
||||||
|
@ -231,6 +231,20 @@ class ConfigTest(unittest.TestCase):
|
|||||||
assert volumes['simple'] == {}
|
assert volumes['simple'] == {}
|
||||||
assert volumes['other'] == {}
|
assert volumes['other'] == {}
|
||||||
|
|
||||||
|
def test_volume_invalid_driver_opt(self):
|
||||||
|
config_details = build_config_details({
|
||||||
|
'version': '2',
|
||||||
|
'services': {
|
||||||
|
'simple': {'image': 'busybox'}
|
||||||
|
},
|
||||||
|
'volumes': {
|
||||||
|
'simple': {'driver_opts': {'size': 42}},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
with pytest.raises(ConfigurationError) as exc:
|
||||||
|
config.load(config_details)
|
||||||
|
assert 'driver_opts.size contains an invalid type' in exc.exconly()
|
||||||
|
|
||||||
def test_load_service_with_name_version(self):
|
def test_load_service_with_name_version(self):
|
||||||
with mock.patch('compose.config.config.log') as mock_logging:
|
with mock.patch('compose.config.config.log') as mock_logging:
|
||||||
config_data = config.load(
|
config_data = config.load(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user