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

Signed-off-by: Brandt Keller <brandt.keller@defenseunicorns.com>
pull/30902/head
Brandt Keller 4 months ago
parent f147277a59
commit c225c124ac
No known key found for this signature in database

@ -459,7 +459,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