mirror of
https://github.com/distribution/distribution
synced 2024-11-06 19:35:52 +01:00
fix: skip removing layer's link file when '--dry-run' option specified (#4425)
This commit is contained in:
commit
ad737939a1
@ -169,6 +169,10 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis
|
||||
|
||||
for repo, dgsts := range deleteLayerSet {
|
||||
for _, dgst := range dgsts {
|
||||
emit("%s: layer link eligible for deletion: %s", repo, dgst)
|
||||
if opts.DryRun {
|
||||
continue
|
||||
}
|
||||
err = vacuum.RemoveLayer(repo, dgst)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to delete layer link %s of repo %s: %v", dgst, repo, err)
|
||||
|
Loading…
Reference in New Issue
Block a user