Skip to content

Commit 65024e6

Browse files
committed
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 ccc41e6 commit 65024e6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/images/image.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ func Platforms(ctx context.Context, provider content.Provider, image ocispec.Des
272272
var platformSpecs []ocispec.Platform
273273
return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
274274
if desc.Platform != nil {
275+
if desc.Platform.OS == "unknown" || desc.Platform.Architecture == "unknown" {
276+
return nil, ErrSkipDesc
277+
}
275278
platformSpecs = append(platformSpecs, *desc.Platform)
276279
return nil, ErrSkipDesc
277280
}

0 commit comments

Comments
 (0)