Skip to content

Commit

Permalink
fix: forward config_path to oci_pull (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn authored Nov 29, 2023
1 parent 612e472 commit 87c72ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/pull.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion oci/pull.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ _PLATFORM_TO_BAZEL_CPU = {
"linux/mips64le": "@platforms//cpu:mips64",
}

def oci_pull(name, image = None, repository = None, registry = None, platforms = None, digest = None, tag = None, reproducible = True, is_bzlmod = False):
def oci_pull(name, image = None, repository = None, registry = None, platforms = None, digest = None, tag = None, reproducible = True, is_bzlmod = False, config_path = None):
"""Repository macro to fetch image manifest data from a remote docker registry.
To use the resulting image, you can use the `@wkspc` shorthand label, for example
Expand Down Expand Up @@ -83,6 +83,7 @@ def oci_pull(name, image = None, repository = None, registry = None, platforms =
Exactly one of `tag` and `digest` must be set.
Since tags are mutable, this is not reproducible, so a warning is printed.
reproducible: Set to False to silence the warning about reproducibility when using `tag`.
config_path: Label to a text file that contains the path of .docker/config.json. by default this is generated by oci_auth_config in oci_register_toolchains macro.
is_bzlmod: whether the oci_pull is being called from a module extension
"""

Expand Down Expand Up @@ -126,6 +127,7 @@ def oci_pull(name, image = None, repository = None, registry = None, platforms =
identifier = digest or tag,
platform = plat,
target_name = plat_name,
config_path = config_path
)
if plat in _PLATFORM_TO_BAZEL_CPU:
platform_to_image[_PLATFORM_TO_BAZEL_CPU[plat]] = "@" + plat_name
Expand All @@ -138,6 +140,7 @@ def oci_pull(name, image = None, repository = None, registry = None, platforms =
repository = repository,
identifier = digest or tag,
target_name = single_platform,
config_path = config_path
)

oci_alias(
Expand Down

0 comments on commit 87c72ec

Please sign in to comment.