fix(client): return nil on non-allowed media types

Signed-off-by: Brandt Keller <brandt.keller@defenseunicorns.com>
(cherry picked from commit c225c124ac)
pull/31037/head
Brandt Keller 4 months ago committed by Matt Farina
parent 015531ca4f
commit 1a8507fd5a
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9

@ -490,7 +490,7 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
PreCopy: func(_ context.Context, desc ocispec.Descriptor) error {
mediaType := desc.MediaType
if i := sort.SearchStrings(allowedMediaTypes, mediaType); i >= len(allowedMediaTypes) || allowedMediaTypes[i] != mediaType {
return errors.Errorf("media type %q is not allowed, found in descriptor with digest: %q", mediaType, desc.Digest)
return nil
}
mu.Lock()

Loading…
Cancel
Save