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

fix: support external oci_image targets #622

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions e2e/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
load("@aspect_bazel_lib//lib:testing.bzl", "assert_json_matches")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@container_structure_test//:defs.bzl", "container_structure_test")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")

# SMOKE TEST: oci_image
oci_image(
name = "image",
base = "@distroless_base",
Expand All @@ -16,6 +18,7 @@ oci_image(
},
)

# SMOKE TEST: oci_tarball
tags = [
"my/image:some-tag",
"my/image:latest",
Expand Down Expand Up @@ -58,3 +61,9 @@ assert_json_matches(
file2 = ":expected_RepoTags",
filter1 = ".[0].RepoTags",
)

# SMOKE TEST: oci_image from an external repo
build_test(
name = "test_external",
targets = ["@rules_oci//examples/assertion/empty"],
)
12 changes: 12 additions & 0 deletions examples/assertion/empty/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@rules_oci//oci:defs.bzl", "oci_image")

# See e2e/smoke folder
oci_image(
name = "empty",
architecture = "amd64",
labels = {
"org.opencontainers.image.ref.name": "ubuntu",
},
os = "linux",
visibility = ["//visibility:public"],
)
16 changes: 8 additions & 8 deletions oci/private/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ CRANE_VERSIONS = {
}

REGCTL_VERSIONS = {
"v0.6.0": {
"darwin-amd64": "sha256-jH9+I397Jjp5Catott8GAVy4Lq9ZE5sA3h7srrE8uUU=",
"darwin-arm64": "sha256-JRBv8uYOEKJ7AvNGu+aKkXKu44uy4g35zuGBLg6vS2o=",
"linux-amd64": "sha256-RCFsCrO9Qa4wsHOS1s2raXH0irP3JADmF/Xw3tTXB0I=",
"linux-arm64": "sha256-DFMgbsSpUHQvob0LZcY8AL+8YDGlKqZUp3QpTjDBLz8=",
"linux-ppc64le": "sha256-5sBcJpl6wK+XRjdSUg8rB5Nd+HOEsMSznW2oRCV0F2U=",
"linux-s390x": "sha256-HHz7RCyLivPZsx/YX+vvHDxA07sZzmrNxoiq2Zi5BX8=",
"windows-amd64": "sha256-KZDxscGWkz+TGfqiodSe+Uy4p9joPvOu3sZHfptzg8Y=",
"v0.7.0": {
"darwin-amd64": "sha256-QH7AeVJi/Ehn09yCVDq1qWvO6VBwquAFV6uPQyX5DDQ=",
"darwin-arm64": "sha256-QTr9nUPdjknzYTnOgfKG32C2id3aPngG82V7zLOWQL8=",
"linux-amd64": "sha256-bOqTeXl+IM7PWeRlaidxkoWSzAzsWMlnzc/aS1qbOK4=",
"linux-arm64": "sha256-L8DiP9/dEhNYD8n8sT0iY/HfvEoRGQsTbbExr9Ah3nk=",
"linux-ppc64le": "sha256-wb0nfYNge8esvD4td9HSqCWkyrDlo7vTyBljx0y4/14=",
"linux-s390x": "sha256-Izfw4uXgOPr6hatQl9wBLD/+Ocv9oXOWhLunvdeWIcA=",
"windows-amd64": "sha256-2JumZSB40AdocaCccOP5yZudxPIDadDDsKlZCfw8/ko=",
},
}
2 changes: 1 addition & 1 deletion oci/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ regctl_toolchain(
regctl = "regctl{ext}",
)
"""
REGCTL_VERSION = "v0.6.0"
REGCTL_VERSION = "v0.7.0"

def _regctl_repo_impl(rctx):
platform = rctx.attr.platform.replace("_", "-")
Expand Down
Loading