mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-21 05:07:22 +00:00
Runtime: Delete corresponding devices when deleting container
This commit is contained in:
committed by
Tianon Gravi
parent
b0626f403b
commit
30890c7763
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user