From be1476f24b5d19eca5078b7305bd6425c7ee7d78 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 21 Mar 2016 14:41:28 -0400 Subject: [PATCH] Only allow tmpfs on v2. Signed-off-by: Daniel Nephin --- compose/config/config_schema_v1.json | 1 - tests/integration/service_test.py | 2 ++ tests/unit/config/config_test.py | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compose/config/config_schema_v1.json b/compose/config/config_schema_v1.json index 9fad7d00d..36a937938 100644 --- a/compose/config/config_schema_v1.json +++ b/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", diff --git a/tests/integration/service_test.py b/tests/integration/service_test.py index 22cbfcee1..e34853466 100644 --- a/tests/integration/service_test.py +++ b/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) diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index e3dac160c..04d82c811 100644 --- a/tests/unit/config/config_test.py +++ b/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 == [