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>
Upstream-commit: 0eed34755e3493dbb6204cb378228e72750609e5
Component: engine
This commit is contained in:
Brian Goff
2016-01-25 15:44:59 -05:00
parent 5bf3651a12
commit db8ec5360f

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 {