From 0916f124d0d35bc0145b11b82b4721db10c779f1 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Mon, 3 Jul 2017 17:12:39 -0700 Subject: [PATCH] `scale` property should be merged according to standard scalar rules Signed-off-by: Joffrey F --- compose/config/config.py | 1 + tests/unit/config/config_test.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) 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',