Skip to content

Commit

Permalink
core/image: fix usage of "unknown" platform
Browse files Browse the repository at this point in the history
"unknown" should not be returned as a valid platform
supported by the image

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
  • Loading branch information
akhilerm authored and k8s-infra-cherrypick-robot committed May 26, 2024
1 parent d55b748 commit d4d4894
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions images/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ func Platforms(ctx context.Context, provider content.Provider, image ocispec.Des
var platformSpecs []ocispec.Platform
return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
if desc.Platform != nil {
if desc.Platform.OS == "unknown" || desc.Platform.Architecture == "unknown" {
return nil, ErrSkipDesc
}
platformSpecs = append(platformSpecs, *desc.Platform)
return nil, ErrSkipDesc
}
Expand Down

0 comments on commit d4d4894

Please sign in to comment.