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

Runtime: Delete corresponding devices when deleting container

This commit is contained in:
Alexander Larsson 2013-09-06 12:03:21 +02:00 committed by Victor Vieux
parent 94fa3c7bb5
commit 19ba0b851b

View file

@ -282,6 +282,11 @@ func (runtime *Runtime) Destroy(container *Container) error {
if err := os.RemoveAll(container.root); err != nil {
return fmt.Errorf("Unable to remove filesystem for %v: %v", container.ID, err)
}
if runtime.GetMountMethod() == MountMethodDeviceMapper {
if err := runtime.deviceSet.RemoveDevice(container.ID); err != nil {
return fmt.Errorf("Unable to remove device for %v: %v", container.ID, err)
}
}
return nil
}