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:
Joffrey F 2016-01-04 15:10:32 -08:00
commit 05935b5e54
4 changed files with 51 additions and 2 deletions

View file

@ -235,6 +235,12 @@ class Project(object):
def initialize_volumes(self):
try:
for volume in self.volumes:
if volume.is_user_created:
log.info(
'Found user-created volume "{0}". No new namespaced '
'volume will be created.'.format(volume.name)
)
continue
volume.create()
except NotFound:
raise ConfigurationError(