Merge pull request #30902 from brandtkeller/30890_prov_mediatype_allow

fix(client): allow layer selection permissive
pull/30910/head
Matt Farina 4 months ago committed by GitHub
commit 806d59750a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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 oras.SkipNode
}
mu.Lock()
@ -504,7 +504,6 @@ func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error) {
return nil, err
}
descriptors = append(descriptors, manifest)
descriptors = append(descriptors, layers...)
numDescriptors := len(descriptors)

Loading…
Cancel
Save