mirror of https://github.com/docker/docs.git
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:
parent
15cc67b73d
commit
0eed34755e
|
@ -43,17 +43,16 @@ func (daemon *Daemon) ContainerRm(name string, config *types.ContainerRmConfig)
|
||||||
return daemon.rmLink(container, name)
|
return daemon.rmLink(container, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := daemon.cleanupContainer(container, config.ForceRemove); err != nil {
|
err = daemon.cleanupContainer(container, config.ForceRemove)
|
||||||
|
if err == nil || config.ForceRemove {
|
||||||
|
if e := daemon.removeMountPoints(container, config.RemoveVolume); e != nil {
|
||||||
|
logrus.Error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := daemon.removeMountPoints(container, config.RemoveVolume); err != nil {
|
|
||||||
logrus.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (daemon *Daemon) rmLink(container *container.Container, name string) error {
|
func (daemon *Daemon) rmLink(container *container.Container, name string) error {
|
||||||
if name[0] != '/' {
|
if name[0] != '/' {
|
||||||
name = "/" + name
|
name = "/" + name
|
||||||
|
|
Loading…
Reference in New Issue