diff --git a/compose/config/config.py b/compose/config/config.py index fb5442566..86cf1b39d 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -116,6 +116,7 @@ ALLOWED_KEYS = DOCKER_CONFIG_KEYS + [ 'logging', 'network_mode', 'init', + 'scale', ] DOCKER_VALID_URL_PREFIXES = ( diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index 6178447ae..721a428e1 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -2098,6 +2098,19 @@ class ConfigTest(unittest.TestCase): actual = config.merge_service_dicts(base, override, V3_3) assert actual['credential_spec'] == override['credential_spec'] + def test_merge_scale(self): + base = { + 'image': 'bar', + 'scale': 2, + } + + override = { + 'scale': 4, + } + + actual = config.merge_service_dicts(base, override, V2_2) + assert actual == {'image': 'bar', 'scale': 4} + def test_external_volume_config(self): config_details = build_config_details({ 'version': '2',