diff --git a/unpacker.go b/unpacker.go index 76f5d7b0c4fb..d9e120dce97f 100644 --- a/unpacker.go +++ b/unpacker.go @@ -65,11 +65,16 @@ func (c *Client) newUnpacker(ctx context.Context, rCtx *RemoteContext) (*unpacke return nil, err } } + var limiter *semaphore.Weighted + if rCtx.MaxConcurrentDownloads > 0 { + limiter = semaphore.NewWeighted(int64(rCtx.MaxConcurrentDownloads)) + } return &unpacker{ updateCh: make(chan ocispec.Descriptor, 128), snapshotter: snapshotter, config: config, c: c, + limiter: limiter, }, nil }