Merge pull request #4472 from fuweid/ignore-error
runtime: ignore ErrNotExist when remove rootfs
This commit is contained in:
commit
5c73fe06a8
@ -121,7 +121,7 @@ func (b *Bundle) Delete() error {
|
|||||||
if err := mount.UnmountAll(rootfs, 0); err != nil {
|
if err := mount.UnmountAll(rootfs, 0); err != nil {
|
||||||
return errors.Wrapf(err, "unmount rootfs %s", rootfs)
|
return errors.Wrapf(err, "unmount rootfs %s", rootfs)
|
||||||
}
|
}
|
||||||
if err := os.Remove(rootfs); err != nil && os.IsNotExist(err) {
|
if err := os.Remove(rootfs); err != nil && !os.IsNotExist(err) {
|
||||||
return errors.Wrap(err, "failed to remove bundle rootfs")
|
return errors.Wrap(err, "failed to remove bundle rootfs")
|
||||||
}
|
}
|
||||||
err := atomicDelete(b.Path)
|
err := atomicDelete(b.Path)
|
||||||
|
Loading…
Reference in New Issue
Block a user