-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/1.6] Fix usage of "unknown" platform #10268
[release/1.6] Fix usage of "unknown" platform #10268
Conversation
"unknown" should not be returned as a valid platform supported by the image Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
Hi @k8s-infra-cherrypick-robot. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -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" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should also update the function description to mention that such platforms are omitted; I just noticed that it's not called out, so a caller may expect the list to include any platform (including the unknown/unknown
ones);
// Platforms returns one or more platforms supported by the image.
func Platforms(ctx context.Context, provider content.Provider, image ocispec.Descriptor) ([]ocispec.Platform, error) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since unknown/unknown
is not really a platform supported by image, I think the current comment should be good.
I can create a separate PR to give a more detailed description in the comment, as this is opened from the cherry-pick bot.
This is an automated cherry-pick of #10257
/assign akhilerm