Skip to content

Commit 566c535

Browse files
authored
Merge pull request #10261 from k8s-infra-cherrypick-robot/cherry-pick-10257-to-release/1.7
[release/1.7] core/image: fix usage of "unknown" platform
2 parents d054b87 + f4d1191 commit 566c535

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

images/image.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ func Platforms(ctx context.Context, provider content.Provider, image ocispec.Des
268268
var platformSpecs []ocispec.Platform
269269
return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
270270
if desc.Platform != nil {
271+
if desc.Platform.OS == "unknown" || desc.Platform.Architecture == "unknown" {
272+
return nil, ErrSkipDesc
273+
}
271274
platformSpecs = append(platformSpecs, *desc.Platform)
272275
return nil, ErrSkipDesc
273276
}

0 commit comments

Comments
 (0)