diff --git a/pkg/extensions/sync/on_demand.go b/pkg/extensions/sync/on_demand.go index edda06d5..e4ad0d1d 100644 --- a/pkg/extensions/sync/on_demand.go +++ b/pkg/extensions/sync/on_demand.go @@ -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) diff --git a/pkg/extensions/sync/sync.go b/pkg/extensions/sync/sync.go index 6633a7ec..5ed08ca7 100644 --- a/pkg/extensions/sync/sync.go +++ b/pkg/extensions/sync/sync.go @@ -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())