Merge pull request #4472 from fuweid/ignore-error

runtime: ignore ErrNotExist when remove rootfs
This commit is contained in:
Akihiro Suda 2020-08-24 20:08:52 +09:00 committed by GitHub
commit 5c73fe06a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)