Sfoglia il codice sorgente

Merge pull request #591 from npeters/fix-insecure-registry

fix insecure parameter
Aanand Prasad 11 anni fa
parent
commit
cb275b8633
2 ha cambiato i file con 4 aggiunte e 6 eliminazioni
  1. 1 2
      fig/project.py
  2. 3 4
      fig/service.py

+ 1 - 2
fig/project.py

@@ -169,10 +169,9 @@ class Project(object):
 
     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):

+ 3 - 4
fig/service.py

@@ -188,16 +188,15 @@ class Service(object):
                 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:
@@ -205,7 +204,7 @@ class Service(object):
 
             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