Skip to content

Commit

Permalink
Merge pull request moby#5915 from vieux/start_remove_link
Browse files Browse the repository at this point in the history
starts by removing the name from the graph db
  • Loading branch information
creack committed May 19, 2014
2 parents 2d1c245 + c12dd77 commit b5d0bdc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down

0 comments on commit b5d0bdc

Please sign in to comment.