Skip to content

Commit

Permalink
Merge pull request docker#591 from npeters/fix-insecure-registry
Browse files Browse the repository at this point in the history
fix insecure parameter
  • Loading branch information
aanand committed Nov 3, 2014
2 parents 604b370 + b64ea85 commit cb275b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions fig/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@ def build(self, service_names=None, no_cache=False):

def up(self, service_names=None, start_links=True, recreate=True, insecure_registry=False):
running_containers = []

for service in self.get_services(service_names, include_links=start_links):
if recreate:
for (_, container) in service.recreate_containers():
for (_, container) in service.recreate_containers(insecure_registry=insecure_registry):
running_containers.append(container)
else:
for container in service.start_or_create_containers(insecure_registry=insecure_registry):
Expand Down
7 changes: 3 additions & 4 deletions fig/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,23 @@ def create_container(self, one_off=False, insecure_registry=False, **override_op
return Container.create(self.client, **container_options)
raise

def recreate_containers(self, **override_options):
def recreate_containers(self, insecure_registry=False, **override_options):
"""
If a container for this service doesn't exist, create and start one. If there are
any, stop them, create+start new ones, and remove the old containers.
"""
containers = self.containers(stopped=True)

if not containers:
log.info("Creating %s..." % self._next_container_name(containers))
container = self.create_container(**override_options)
container = self.create_container(insecure_registry=insecure_registry, **override_options)
self.start_container(container)
return [(None, container)]
else:
tuples = []

for c in containers:
log.info("Recreating %s..." % c.name)
tuples.append(self.recreate_container(c, **override_options))
tuples.append(self.recreate_container(c, insecure_registry=insecure_registry, **override_options))

return tuples

Expand Down

0 comments on commit cb275b8

Please sign in to comment.