mirror of
https://github.com/docker/compose.git
synced 2025-07-25 22:54:54 +02:00
Only allow tmpfs on v2.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
28120148f4
commit
be1476f24b
@ -104,7 +104,6 @@
|
|||||||
"shm_size": {"type": ["number", "string"]},
|
"shm_size": {"type": ["number", "string"]},
|
||||||
"stdin_open": {"type": "boolean"},
|
"stdin_open": {"type": "boolean"},
|
||||||
"stop_signal": {"type": "string"},
|
"stop_signal": {"type": "string"},
|
||||||
"tmpfs": {"$ref": "#/definitions/string_or_list"},
|
|
||||||
"tty": {"type": "boolean"},
|
"tty": {"type": "boolean"},
|
||||||
"ulimits": {
|
"ulimits": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -28,6 +28,7 @@ from compose.service import ConvergencePlan
|
|||||||
from compose.service import ConvergenceStrategy
|
from compose.service import ConvergenceStrategy
|
||||||
from compose.service import NetworkMode
|
from compose.service import NetworkMode
|
||||||
from compose.service import Service
|
from compose.service import Service
|
||||||
|
from tests.integration.testcases import v2_only
|
||||||
|
|
||||||
|
|
||||||
def create_and_start_container(service, **override_options):
|
def create_and_start_container(service, **override_options):
|
||||||
@ -875,6 +876,7 @@ class ServiceTest(DockerClientTestCase):
|
|||||||
container = create_and_start_container(service)
|
container = create_and_start_container(service)
|
||||||
self.assertEqual(container.get('HostConfig.DnsSearch'), ['dc1.example.com', 'dc2.example.com'])
|
self.assertEqual(container.get('HostConfig.DnsSearch'), ['dc1.example.com', 'dc2.example.com'])
|
||||||
|
|
||||||
|
@v2_only()
|
||||||
def test_tmpfs(self):
|
def test_tmpfs(self):
|
||||||
service = self.create_service('web', tmpfs=['/run'])
|
service = self.create_service('web', tmpfs=['/run'])
|
||||||
container = create_and_start_container(service)
|
container = create_and_start_container(service)
|
||||||
|
@ -1196,9 +1196,12 @@ class ConfigTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_tmpfs_option(self):
|
def test_tmpfs_option(self):
|
||||||
actual = config.load(build_config_details({
|
actual = config.load(build_config_details({
|
||||||
'web': {
|
'version': '2',
|
||||||
'image': 'alpine',
|
'services': {
|
||||||
'tmpfs': '/run',
|
'web': {
|
||||||
|
'image': 'alpine',
|
||||||
|
'tmpfs': '/run',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
assert actual.services == [
|
assert actual.services == [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user