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