Browse Source

starts by removing the name from the graph db

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Victor Vieux 11 năm trước cách đây
mục cha
commit
c12dd77090
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      daemon/daemon.go

+ 4 - 4
daemon/daemon.go

@@ -291,6 +291,10 @@ func (daemon *Daemon) Destroy(container *Container) error {
 	daemon.idIndex.Delete(container.ID)
 	daemon.containers.Remove(element)
 
+	if _, err := daemon.containerGraph.Purge(container.ID); err != nil {
+		utils.Debugf("Unable to remove container from link graph: %s", err)
+	}
+
 	if err := daemon.driver.Remove(container.ID); err != nil {
 		return fmt.Errorf("Driver %s failed to remove root filesystem %s: %s", daemon.driver, container.ID, err)
 	}
@@ -300,10 +304,6 @@ func (daemon *Daemon) Destroy(container *Container) error {
 		return fmt.Errorf("Driver %s failed to remove init filesystem %s: %s", daemon.driver, initID, err)
 	}
 
-	if _, err := daemon.containerGraph.Purge(container.ID); err != nil {
-		utils.Debugf("Unable to remove container from link graph: %s", err)
-	}
-
 	if err := os.RemoveAll(container.root); err != nil {
 		return fmt.Errorf("Unable to remove filesystem for %v: %v", container.ID, err)
 	}