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 <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2026-01-28 08:27:17 -08:00
parent 841017f665
commit 510369170a
+4 -1
View File
@@ -208,7 +208,10 @@ func runCreate(ctx context.Context, dockerCli command.Cli, in createOptions, arg
for _, desc := range manifests {
eg2.Go(func() error {
sub.Log(1, fmt.Appendf(nil, "copying %s from %s to %s\n", desc.Digest.String(), desc.Source.Ref.String(), t.String()))
return r.Copy(ctx, desc.Source, t)
return r.Copy(ctx, &imagetools.Source{
Ref: desc.Source.Ref,
Desc: desc.Descriptor,
}, t)
})
}
if err := eg2.Wait(); err != nil {