Skip to content

Commit 32e650f

Browse files
committed
imagetools: fix excessive copies on create command
Currently needed manifests were filtered out and then copied in a loop, but for each copy still the full unfiltered descriptor was copied instead of single manifest, resulting multiple push attempts for same descriptor. Signed-off-by: Tonis Tiigi <[email protected]>
1 parent 44945d7 commit 32e650f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

commands/imagetools/create.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ func runCreate(ctx context.Context, dockerCli command.Cli, in createOptions, arg
209209
eg2.Go(func() error {
210210
ctx = withMediaTypeKeyPrefix(baseCtx)
211211
sub.Log(1, fmt.Appendf(nil, "copying %s from %s to %s\n", desc.Digest.String(), desc.Source.Ref.String(), t.String()))
212-
return r.Copy(ctx, desc.Source, t)
212+
return r.Copy(ctx, &imagetools.Source{
213+
Ref: desc.Source.Ref,
214+
Desc: desc.Descriptor,
215+
}, t)
213216
})
214217
}
215218
if err := eg2.Wait(); err != nil {

0 commit comments

Comments
 (0)