diff --git a/core/unpack/unpacker.go b/core/unpack/unpacker.go index 91d9e8111..5bf9baf2f 100644 --- a/core/unpack/unpacker.go +++ b/core/unpack/unpacker.go @@ -262,7 +262,8 @@ func (u *Unpacker) unpack( } if unpack == nil { - return fmt.Errorf("unpacker does not support platform %s for image %s", imgPlatform, config.Digest) + log.G(ctx).WithField("image", config.Digest).WithField("platform", platforms.Format(imgPlatform)).Debugf("unpacker does not support platform, only fetching layers") + return u.fetch(ctx, h, layers, nil) } atomic.AddInt32(&u.unpacks, 1) @@ -460,12 +461,18 @@ func (u *Unpacker) fetch(ctx context.Context, h images.Handler, layers []ocispec tracing.Attribute("layer.media.digest", desc.Digest.String()), ) desc := desc - i := i + var ch chan struct{} + if done != nil { + ch = done[i] + } + if err := u.acquire(ctx); err != nil { return err } eg.Go(func() error { + defer layerSpan.End() + unlock, err := u.lockBlobDescriptor(ctx2, desc) if err != nil { u.release() @@ -480,11 +487,12 @@ func (u *Unpacker) fetch(ctx context.Context, h images.Handler, layers []ocispec if err != nil && !errors.Is(err, images.ErrSkipDesc) { return err } - close(done[i]) + if ch != nil { + close(ch) + } return nil }) - layerSpan.End() } return eg.Wait()