From b726f508a62b58c718b3568a51200224a613eed4 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 1 Mar 2016 11:42:19 -0500 Subject: [PATCH] Fix merging of logging options in v1 config. Signed-off-by: Daniel Nephin --- compose/config/config.py | 2 ++ tests/unit/config/config_test.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/compose/config/config.py b/compose/config/config.py index 850af31c9..f34809a9e 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -88,6 +88,8 @@ ALLOWED_KEYS = DOCKER_CONFIG_KEYS + [ 'build', 'container_name', 'dockerfile', + 'log_driver', + 'log_opt', 'logging', 'network_mode', ] diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index c2ca8e6ee..420db60b6 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -1248,6 +1248,24 @@ class ConfigTest(unittest.TestCase): } } + def test_merge_logging_v1(self): + base = { + 'image': 'alpine:edge', + 'log_driver': 'something', + 'log_opt': {'foo': 'three'}, + } + override = { + 'image': 'alpine:edge', + 'command': 'true', + } + actual = config.merge_service_dicts(base, override, V1) + assert actual == { + 'image': 'alpine:edge', + 'log_driver': 'something', + 'log_opt': {'foo': 'three'}, + 'command': 'true', + } + def test_external_volume_config(self): config_details = build_config_details({ 'version': '2',