mirror of https://github.com/docker/compose.git
Update service config_dict computation to include volumes_from mode
Ensure config_hash is updated when volumes_from mode is changed, and service is recreated on next up as a result. Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
cf93362368
commit
3daecfa8e4
|
@ -511,7 +511,9 @@ class Service(object):
|
||||||
'image_id': self.image()['Id'],
|
'image_id': self.image()['Id'],
|
||||||
'links': self.get_link_names(),
|
'links': self.get_link_names(),
|
||||||
'net': self.net.id,
|
'net': self.net.id,
|
||||||
'volumes_from': self.get_volumes_from_names(),
|
'volumes_from': [
|
||||||
|
(v.source.name, v.mode) for v in self.volumes_from if isinstance(v.source, Service)
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_dependency_names(self):
|
def get_dependency_names(self):
|
||||||
|
|
|
@ -417,7 +417,7 @@ class ServiceTest(unittest.TestCase):
|
||||||
'options': {'image': 'example.com/foo'},
|
'options': {'image': 'example.com/foo'},
|
||||||
'links': [('one', 'one')],
|
'links': [('one', 'one')],
|
||||||
'net': 'other',
|
'net': 'other',
|
||||||
'volumes_from': ['two'],
|
'volumes_from': [('two', 'rw')],
|
||||||
}
|
}
|
||||||
self.assertEqual(config_dict, expected)
|
self.assertEqual(config_dict, expected)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue