Skip to content

Commit

Permalink
fix: support external oci_image targets (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Jul 18, 2024
1 parent 227ac26 commit e822897
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
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_load")

# 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

0 comments on commit e822897

Please sign in to comment.