From 4bed5de291307f4099b6abb564bc8c2cf472dbc3 Mon Sep 17 00:00:00 2001 From: Mazz Mosley Date: Wed, 9 Sep 2015 16:04:27 +0100 Subject: [PATCH] Remove item unique constraint for command The command value can be a list, which would be a Unix command-line invocation broken up into individual values, thus needing the ability to have non unique values. Signed-off-by: Mazz Mosley --- compose/config/fields_schema.json | 7 ++++++- tests/unit/config_test.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compose/config/fields_schema.json b/compose/config/fields_schema.json index a82dd397d..bc033f2d8 100644 --- a/compose/config/fields_schema.json +++ b/compose/config/fields_schema.json @@ -17,7 +17,12 @@ "build": {"type": "string"}, "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, - "command": {"$ref": "#/definitions/string_or_list"}, + "command": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, "container_name": {"type": "string"}, "cpu_shares": { "oneOf": [ diff --git a/tests/unit/config_test.py b/tests/unit/config_test.py index aeebc049f..9d67a8917 100644 --- a/tests/unit/config_test.py +++ b/tests/unit/config_test.py @@ -183,7 +183,7 @@ class ConfigTest(unittest.TestCase): ) def test_invalid_list_of_strings_format(self): - expected_error_msg = "'command' contains an invalid type, valid types are string or list of strings" + expected_error_msg = "'command' contains an invalid type, valid types are string or array" with self.assertRaisesRegexp(ConfigurationError, expected_error_msg): config.load( config.ConfigDetails(