imagetools: fix pushing same image with multiple names

containerd pusher can’t handle this case atm so we
need to make sure we always create a new resolver
for each name.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2021-10-27 17:14:49 -07:00
parent 4690e14c40
commit b497587f21
2 changed files with 12 additions and 9 deletions

View File

@ -150,7 +150,7 @@ func (r *Resolver) Combine(ctx context.Context, in string, descs []ocispec.Descr
func (r *Resolver) Push(ctx context.Context, ref reference.Named, desc ocispec.Descriptor, dt []byte) error {
ref = reference.TagNameOnly(ref)
p, err := r.r.Pusher(ctx, ref.String())
p, err := r.resolver().Pusher(ctx, ref.String())
if err != nil {
return err
}