Skip to content

Commit f4d1191

Browse files
akhilermk8s-infra-cherrypick-robot
authored andcommitted
core/image: fix usage of "unknown" platform
"unknown" should not be returned as a valid platform supported by the image Signed-off-by: Akhil Mohan <[email protected]>
1 parent 3a4de45 commit f4d1191

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)