runtime: ignore ErrNotExist when remove rootfs

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu 2020-08-12 20:04:50 +08:00
parent e87c38ae05
commit 73b1449278

View File

@ -121,7 +121,7 @@ func (b *Bundle) Delete() error {
if err := mount.UnmountAll(rootfs, 0); err != nil {
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")
}
err := atomicDelete(b.Path)