From 3ebfa4b089448968d168593c32e3544f2e6e3c5b Mon Sep 17 00:00:00 2001 From: Mark Gallagher Date: Fri, 13 Nov 2020 01:50:59 +0000 Subject: [PATCH] Remove duplicate values check for build.cache_from The `docker` command accepts duplicate values, so there is no benefit to performing this check. Fixes #7342. Signed-off-by: Mark Gallagher --- compose/config/compose_spec.json | 2 +- tests/unit/config/config_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compose/config/compose_spec.json b/compose/config/compose_spec.json index 268256744..38cc27fd2 100644 --- a/compose/config/compose_spec.json +++ b/compose/config/compose_spec.json @@ -87,7 +87,7 @@ "dockerfile": {"type": "string"}, "args": {"$ref": "#/definitions/list_or_dict"}, "labels": {"$ref": "#/definitions/list_or_dict"}, - "cache_from": {"$ref": "#/definitions/list_of_strings"}, + "cache_from": {"type": "array", "items": {"type": "string"}}, "network": {"type": "string"}, "target": {"type": "string"}, "shm_size": {"type": ["integer", "string"]}, diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index 426a7c978..ffc16e085 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -669,7 +669,7 @@ class ConfigTest(unittest.TestCase): assert 'Invalid service name \'mong\\o\'' in excinfo.exconly() - def test_config_duplicate_cache_from_values_validation_error(self): + def test_config_duplicate_cache_from_values_no_validation_error(self): with pytest.raises(ConfigurationError) as exc: config.load( build_config_details({ @@ -681,7 +681,7 @@ class ConfigTest(unittest.TestCase): }) ) - assert 'build.cache_from contains non-unique items' in exc.exconly() + assert 'build.cache_from contains non-unique items' not in exc.exconly() def test_load_with_multiple_files_v1(self): base_file = config.ConfigFile(