mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #4499 from alexlarsson/fix-remove-fail
DeviceMapper: Succeed immediately when removing non-existant devices
This commit is contained in:
commit
af3ff044a2
1 changed files with 7 additions and 0 deletions
|
@ -90,6 +90,13 @@ func (d *Driver) Create(id, parent string) error {
|
|||
}
|
||||
|
||||
func (d *Driver) Remove(id string) error {
|
||||
if !d.DeviceSet.HasDevice(id) {
|
||||
// Consider removing a non-existing device a no-op
|
||||
// This is useful to be able to progress on container removal
|
||||
// if the underlying device has gone away due to earlier errors
|
||||
return nil
|
||||
}
|
||||
|
||||
// Sink the float from create in case no Get() call was made
|
||||
if err := d.DeviceSet.UnmountDevice(id, UnmountSink); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue