sync: cleanup the orphaned private download dir on failure, closes 282

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Petu Eusebiu
2021-11-18 14:52:32 +02:00
committed by Ramkumar Chinchani
parent 7ada50e9c8
commit f0ef10fa50
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -87,6 +87,8 @@ func OneImage(cfg Config, log log.Logger,
return err
}
defer os.RemoveAll(path.Join(imageStore.RootDir(), imageName, SyncBlobUploadDir, uuid.String()))
localTaggedRepo := fmt.Sprintf("%s:%s", localRepo, tag)
localRef, err := layout.ParseReference(localTaggedRepo)
+2
View File
@@ -382,6 +382,8 @@ func syncRegistry(regCfg RegistryConfig, storeController storage.StoreController
return err
}
defer os.RemoveAll(path.Join(imageStore.RootDir(), imageName, SyncBlobUploadDir, uuid))
upstreamTaggedRef := getTagFromRef(upstreamRef, log)
localTaggedRepo := fmt.Sprintf("%s:%s", localRepo, upstreamTaggedRef.Tag())