mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-19 20:26:54 +00:00
Runtime: Only remove device on destroy if it exists
This commit is contained in:
committed by
Tianon Gravi
parent
0d7ab8db03
commit
5f8e24f842
+1
-1
@@ -288,7 +288,7 @@ 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 runtime.GetMountMethod() == MountMethodDeviceMapper && runtime.deviceSet.HasDevice(container.ID) {
|
||||
if err := runtime.deviceSet.RemoveDevice(container.ID); err != nil {
|
||||
return fmt.Errorf("Unable to remove device for %v: %v", container.ID, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user