Преглед на файлове

Add missing comma in DOCKER_CONFIG_KEYS list

Signed-off-by: Joffrey F <[email protected]>
Joffrey F преди 8 години
родител
ревизия
7e8958e6ca
променени са 2 файла, в които са добавени 19 реда и са изтрити 1 реда
  1. 1 1
      compose/config/config.py
  2. 18 0
      tests/unit/config/config_test.py

+ 1 - 1
compose/config/config.py

@@ -78,7 +78,7 @@ DOCKER_CONFIG_KEYS = [
     'memswap_limit',
     'mem_swappiness',
     'net',
-    'oom_score_adj'
+    'oom_score_adj',
     'pid',
     'ports',
     'privileged',

+ 18 - 0
tests/unit/config/config_test.py

@@ -1748,6 +1748,24 @@ class ConfigTest(unittest.TestCase):
             }
         }
 
+    def test_merge_pid(self):
+        # Regression: https://github.com/docker/compose/issues/4184
+        base = {
+            'image': 'busybox',
+            'pid': 'host'
+        }
+
+        override = {
+            'labels': {'com.docker.compose.test': 'yes'}
+        }
+
+        actual = config.merge_service_dicts(base, override, V2_0)
+        assert actual == {
+            'image': 'busybox',
+            'pid': 'host',
+            'labels': {'com.docker.compose.test': 'yes'}
+        }
+
     def test_external_volume_config(self):
         config_details = build_config_details({
             'version': '2',