Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove err nil check
since type checking nil will not panic and return appropriately

Signed-off-by: Manish Tomar <manish.tomar@docker.com>
Signed-off-by: wang yan <wangyan@vmware.com>
  • Loading branch information
Manish Tomar authored and wy65701436 committed Mar 23, 2021
1 parent 3c64ff1 commit 89e6568
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions registry/storage/garbagecollect.go
Expand Up @@ -98,15 +98,13 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis
return nil
})

if err != nil {
// In certain situations such as unfinished uploads, deleting all
// tags in S3 or removing the _manifests folder manually, this
// error may be of type PathNotFound.
//
// In these cases we can continue marking other manifests safely.
if _, ok := err.(driver.PathNotFoundError); ok {
return nil
}
// In certain situations such as unfinished uploads, deleting all
// tags in S3 or removing the _manifests folder manually, this
// error may be of type PathNotFound.
//
// In these cases we can continue marking other manifests safely.
if _, ok := err.(driver.PathNotFoundError); ok {
return nil
}

return err
Expand Down

0 comments on commit 89e6568

Please sign in to comment.