Skip to content

Commit

Permalink
fix: return correct extension metadata (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn authored Jun 4, 2024
1 parent 1f0870c commit 98efaf8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ oci.pull(
"linux/arm64",
],
)
use_repo(oci, "distroless_base")
use_repo(oci, "distroless_base", "distroless_base_linux_amd64", "distroless_base_linux_arm64")
13 changes: 9 additions & 4 deletions oci/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,21 @@ def _oci_extension(module_ctx):
)

if mod.is_root:
if module_ctx.is_dev_dependency(pull):
root_direct_dev_deps.append(pull.name)
else:
root_direct_deps.append(pull.name)
deps = root_direct_dev_deps if module_ctx.is_dev_dependency(pull) else root_direct_deps
deps.append(pull.name)
for platform in pull.platforms:
deps.append("_".join([pull.name] + platform.split("/")))

for toolchains in mod.tags.toolchains:
if toolchains.name != "oci" and not mod.is_root:
fail("""\
Only the root module may override the default name for the oci toolchains.
This prevents conflicting registrations in the global namespace of external repos.
""")
if mod.is_root:
deps = root_direct_dev_deps if module_ctx.is_dev_dependency(toolchains) else root_direct_deps
deps.append("%s_crane_toolchains" % toolchains.name)
deps.append("%s_regctl_toolchains" % toolchains.name)

oci_register_toolchains(toolchains.name, register = False)

Expand Down

0 comments on commit 98efaf8

Please sign in to comment.