fix(sync): better cleaning sync's download dir (#2273)

added cleanup in the case of copy.Image() failures.

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu
2024-02-29 19:09:21 +02:00
committed by GitHub
parent 6561e9f527
commit 740eae8f26
3 changed files with 26 additions and 4 deletions
+2
View File
@@ -75,6 +75,8 @@ type Destination interface {
CanSkipImage(repo, tag string, imageDigest digest.Digest) (bool, error)
// CommitImage moves a synced repo/ref from temporary oci layout to ImageStore
CommitImage(imageReference types.ImageReference, repo, tag string) error
// Removes image reference, used when copy.Image() errors out
CleanupImage(imageReference types.ImageReference, repo, reference string) error
}
type TaskGenerator struct {