Merge pull request #30905 from robertsirc/forward-port-30902
build-test / build (push) Has been cancelled Details
golangci-lint / golangci-lint (push) Has been cancelled Details
release / release (push) Has been cancelled Details
release / canary-release (push) Has been cancelled Details
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled Details
CodeQL / Analyze (go) (push) Has been cancelled Details
Close stale issues / stale (push) Has been cancelled Details
govulncheck / govulncheck (push) Has been cancelled Details

forward porting 30902
This commit is contained in:
Robert Sirchia 2025-05-23 16:33:39 -04:00 committed by GitHub
commit 39305fc160
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -463,7 +463,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 fmt.Errorf("media type %q is not allowed, found in descriptor with digest: %q", mediaType, desc.Digest)
return oras.SkipNode
}
mu.Lock()
@ -477,7 +477,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)