Merge pull request #9465 from ambarve/sn_cleanup

Don't block snapshot garbage collection on Remove failures
This commit is contained in:
Samuel Karp 2023-12-05 21:33:43 +00:00 committed by GitHub
commit d55bfab176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,7 +282,9 @@ func (s *snapshotter) Remove(ctx context.Context, key string) error {
log.G(ctx).WithError(err1).WithField("path", renamed).Error("Failed to rename after failed commit")
}
}
return err
// Return the error wrapped in ErrFailedPrecondition so that cleanup of other snapshots will
// still continue.
return errors.Join(errdefs.ErrFailedPrecondition, err)
}
if err = hcsshim.DestroyLayer(s.info, renamedID); err != nil {