mirror of
https://github.com/project-zot/zot.git
synced 2024-12-30 22:34:13 -05:00
sync: cleanup the orphaned private download dir on failure, closes 282
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
parent
7ada50e9c8
commit
f0ef10fa50
2 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue