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 <akhilerm@gmail.com>
This commit is contained in:
parent
ccc41e6705
commit
65024e6fd1
@ -272,6 +272,9 @@ func Platforms(ctx context.Context, provider content.Provider, image ocispec.Des
|
|||||||
var platformSpecs []ocispec.Platform
|
var platformSpecs []ocispec.Platform
|
||||||
return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
|
return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
|
||||||
if desc.Platform != nil {
|
if desc.Platform != nil {
|
||||||
|
if desc.Platform.OS == "unknown" || desc.Platform.Architecture == "unknown" {
|
||||||
|
return nil, ErrSkipDesc
|
||||||
|
}
|
||||||
platformSpecs = append(platformSpecs, *desc.Platform)
|
platformSpecs = append(platformSpecs, *desc.Platform)
|
||||||
return nil, ErrSkipDesc
|
return nil, ErrSkipDesc
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user