Add support for ro option in volumes_from
Fixes #1188 Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
19271898de
commit
5b55a08846
7 changed files with 97 additions and 35 deletions
|
|
@ -25,6 +25,7 @@ from compose.service import ConfigError
|
|||
from compose.service import ConvergencePlan
|
||||
from compose.service import Net
|
||||
from compose.service import Service
|
||||
from compose.service import VolumeFromSpec
|
||||
|
||||
|
||||
def create_and_start_container(service, **override_options):
|
||||
|
|
@ -272,12 +273,12 @@ class ServiceTest(DockerClientTestCase):
|
|||
command=["top"],
|
||||
labels={LABEL_PROJECT: 'composetest'},
|
||||
)
|
||||
host_service = self.create_service('host', volumes_from=[volume_service, volume_container_2])
|
||||
host_service = self.create_service('host', volumes_from=[VolumeFromSpec(volume_service, 'rw'), VolumeFromSpec(volume_container_2, 'rw')])
|
||||
host_container = host_service.create_container()
|
||||
host_service.start_container(host_container)
|
||||
self.assertIn(volume_container_1.id,
|
||||
self.assertIn(volume_container_1.id + ':rw',
|
||||
host_container.get('HostConfig.VolumesFrom'))
|
||||
self.assertIn(volume_container_2.id,
|
||||
self.assertIn(volume_container_2.id + ':rw',
|
||||
host_container.get('HostConfig.VolumesFrom'))
|
||||
|
||||
def test_execute_convergence_plan_recreate(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue