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:
parent
b0626f403b
commit
30890c7763
1 changed files with 5 additions and 0 deletions
|
@ -283,6 +283,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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue