Don't recreate pre-existing volumes.
During the initialize_volumes phase, if a volume using the non-namespaced name already exists, don't create the namespaced equivalent. Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
ad8faad296
commit
05935b5e54
4 changed files with 51 additions and 2 deletions
|
|
@ -54,3 +54,13 @@ class VolumeTest(DockerClientTestCase):
|
|||
vol.remove()
|
||||
volumes = self.client.volumes()['Volumes']
|
||||
assert len([v for v in volumes if v['Name'] == vol.full_name]) == 0
|
||||
|
||||
def test_is_user_created(self):
|
||||
vol = Volume(self.client, 'composetest', 'uservolume01')
|
||||
try:
|
||||
self.client.create_volume('uservolume01')
|
||||
assert vol.is_user_created is True
|
||||
finally:
|
||||
self.client.remove_volume('uservolume01')
|
||||
vol2 = Volume(self.client, 'composetest', 'volume01')
|
||||
assert vol2.is_user_created is False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue