Skip to content
Snippets Groups Projects
Unverified Commit 6c04c23f authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Update to support partial folders

parent 6c7dd33b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -71,6 +71,10 @@ func markTags(ctx context.Context, repository distribution.Repository) (tagsSet
tagsService := repository.Tags(ctx)
tags, err := tagsService.All(ctx)
if err != nil {
if _, ok := err.(distribution.ErrRepositoryUnknown); ok {
return tagsSet, manifestsSet, 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.
Loading
Loading
@@ -145,6 +149,10 @@ func markManifests(ctx context.Context, repository distribution.Repository, mani
return nil
})
 
if _, ok := err.(driver.PathNotFoundError); ok {
err = nil
}
return manifestsDeleteSet, blobSet, err
}
 
Loading
Loading
@@ -165,6 +173,10 @@ func markBlobs(ctx context.Context, repository distribution.Repository, blobSet
return nil
})
 
if _, ok := err.(driver.PathNotFoundError); ok {
err = nil
}
return blobDeleteSet, err
}
 
Loading
Loading
@@ -413,8 +425,15 @@ func main() {
logrus.Fatalln(err)
}
 
registry, err := storage.NewRegistry(ctx, driver, storage.Schema1SigningKey(k),
storage.EnableDelete)
options := []storage.RegistryOption{
storage.Schema1SigningKey(k),
}
if !*dryRun {
options = append(options, storage.EnableDelete)
}
registry, err := storage.NewRegistry(ctx, driver, options...)
if err != nil {
logrus.Fatalln("failed to construct registry:", err)
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment