Skip to content
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

feat: add custom no_match_error to oci_alias #364

Merged
merged 1 commit into from
Sep 26, 2023
Merged

Conversation

thesayyn
Copy link
Collaborator

@thesayyn thesayyn commented Sep 18, 2023

Now when there is no matching platform in oci_alias, users will see an error with list of available platforms from the image.

alias(
    name = "chainguard_static",
    actual = select(
        {
           "@platforms//cpu:x86_64": "@chainguard_static_linux_amd64", 
           "@platforms//cpu:arm64": "@chainguard_static_linux_arm64", 
           "@platforms//cpu:ppc": "@chainguard_static_linux_ppc64le", 
           "@platforms//cpu:s390x": "@chainguard_static_linux_s390x"
         },
        no_match_error = """could not find an image matching the target platform. \navailable platforms are "linux/386", "linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/ppc64le", "linux/s390x" """,
    ),
    visibility = ["//visibility:public"],
)

fixes #178

@thesayyn thesayyn requested a review from alexeagle September 18, 2023 23:05
oci/private/pull.bzl Show resolved Hide resolved
oci/private/pull.bzl Show resolved Hide resolved
@thesayyn thesayyn merged commit 3e2065e into main Sep 26, 2023
15 checks passed
@thesayyn thesayyn deleted the no_match_error branch September 26, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

oci_pull - allow you to list the platforms of a multi-arch image
2 participants