瀏覽代碼

Only allow tmpfs on v2.

Signed-off-by: Daniel Nephin <[email protected]>
Daniel Nephin 9 年之前
父節點
當前提交
be1476f24b
共有 3 個文件被更改,包括 8 次插入4 次删除
  1. 0 1
      compose/config/config_schema_v1.json
  2. 2 0
      tests/integration/service_test.py
  3. 6 3
      tests/unit/config/config_test.py

+ 0 - 1
compose/config/config_schema_v1.json

@@ -104,7 +104,6 @@
         "shm_size": {"type": ["number", "string"]},
         "stdin_open": {"type": "boolean"},
         "stop_signal": {"type": "string"},
-        "tmpfs": {"$ref": "#/definitions/string_or_list"},
         "tty": {"type": "boolean"},
         "ulimits": {
           "type": "object",

+ 2 - 0
tests/integration/service_test.py

@@ -28,6 +28,7 @@ from compose.service import ConvergencePlan
 from compose.service import ConvergenceStrategy
 from compose.service import NetworkMode
 from compose.service import Service
+from tests.integration.testcases import v2_only
 
 
 def create_and_start_container(service, **override_options):
@@ -875,6 +876,7 @@ class ServiceTest(DockerClientTestCase):
         container = create_and_start_container(service)
         self.assertEqual(container.get('HostConfig.DnsSearch'), ['dc1.example.com', 'dc2.example.com'])
 
+    @v2_only()
     def test_tmpfs(self):
         service = self.create_service('web', tmpfs=['/run'])
         container = create_and_start_container(service)

+ 6 - 3
tests/unit/config/config_test.py

@@ -1196,9 +1196,12 @@ class ConfigTest(unittest.TestCase):
 
     def test_tmpfs_option(self):
         actual = config.load(build_config_details({
-            'web': {
-                'image': 'alpine',
-                'tmpfs': '/run',
+            'version': '2',
+            'services': {
+                'web': {
+                    'image': 'alpine',
+                    'tmpfs': '/run',
+                }
             }
         }))
         assert actual.services == [