1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix removing mountpoints on container rm fail

Ensure that the the container's mountpoints are cleaned up if the
container is force removed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2016-01-25 15:44:59 -05:00
parent 15cc67b73d
commit 0eed34755e

View file

@ -43,15 +43,14 @@ func (daemon *Daemon) ContainerRm(name string, config *types.ContainerRmConfig)
return daemon.rmLink(container, name)
}
if err := daemon.cleanupContainer(container, config.ForceRemove); err != nil {
return err
err = daemon.cleanupContainer(container, config.ForceRemove)
if err == nil || config.ForceRemove {
if e := daemon.removeMountPoints(container, config.RemoveVolume); e != nil {
logrus.Error(e)
}
}
if err := daemon.removeMountPoints(container, config.RemoveVolume); err != nil {
logrus.Error(err)
}
return nil
return err
}
func (daemon *Daemon) rmLink(container *container.Container, name string) error {