Runtime: Delete corresponding devices when deleting container
Upstream-commit: 19ba0b851bb00248b62a40695a60fc534d0df2cb Component: engine
This commit is contained in:
committed by
Victor Vieux
parent
5c4c83afbc
commit
3ffe64603d
@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user