From 011b7e493b9bd20ee1b5f0453d378e4980bf03e6 Mon Sep 17 00:00:00 2001 From: Tony Holdstock-Brown Date: Mon, 25 Apr 2016 21:14:00 -0700 Subject: [PATCH] Ensure GC continues marking if _manifests is nonexistent Signed-off-by: Tony Holdstock-Brown --- registry/garbagecollect.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/registry/garbagecollect.go b/registry/garbagecollect.go index 7e1d97d9..65d432e0 100644 --- a/registry/garbagecollect.go +++ b/registry/garbagecollect.go @@ -96,6 +96,17 @@ 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 + } + } + return err })