Skip to content

Commit 45e3091

Browse files
authored
Merge pull request containerd#10257 from akhilerm/fix-unknown-platform
core/image: fix usage of "unknown" platform
2 parents ccc41e6 + 65024e6 commit 45e3091

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)