Skip to content

Commit

Permalink
chore: remove deprecated config_path attribute (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Aug 9, 2024
1 parent 0be4040 commit dc2098a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
3 changes: 1 addition & 2 deletions docs/pull.md

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

11 changes: 1 addition & 10 deletions oci/private/pull.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ _IMAGE_REFERENCE_ATTRS = {
doc = "Label to a .docker/config.json file",
allow_single_file = True,
),
"config_path": attr.label(
# TODO(2.0): remove
doc = "Deprecated. Use DOCKER_CONFIG environment variable or config attribute instead. TODO(2.0): remove",
allow_single_file = True,
),
}

SCHEMA1_ERROR = """\
Expand Down Expand Up @@ -72,11 +67,7 @@ _DOWNLOAD_HEADERS = {
def _config_path(rctx):
if rctx.attr.config:
return rctx.path(rctx.attr.config)
elif rctx.attr.config_path:
util.warning(rctx, "attribute config_path is deprecated and will be removed in 2.0. use DOCKER_CONFIG environment variable or config attribute instead.")
return rctx.path(rctx.attr.config_path)
else:
return None
return None

def _is_tag(str):
return str.find(":") == -1
Expand Down
9 changes: 1 addition & 8 deletions oci/pull.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,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, config = None, config_path = None, bazel_tags = []):
def oci_pull(name, image = None, repository = None, registry = None, platforms = None, digest = None, tag = None, reproducible = True, is_bzlmod = False, config = None, bazel_tags = []):
"""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 @@ -136,7 +136,6 @@ def oci_pull(name, image = None, repository = None, registry = None, platforms =
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: Label to a `.docker/config.json` file.
config_path: Deprecated. use `config` attribute or DOCKER_CONFIG environment variable.
is_bzlmod: whether the oci_pull is being called from a module extension
bazel_tags: Bazel tags to be propagated to generated rules.
"""
Expand Down Expand Up @@ -183,8 +182,6 @@ def oci_pull(name, image = None, repository = None, registry = None, platforms =
platform = plat,
target_name = plat_name,
config = config,
# TODO(2.0): remove
config_path = config_path,
bazel_tags = bazel_tags,
)

Expand All @@ -208,8 +205,6 @@ def oci_pull(name, image = None, repository = None, registry = None, platforms =
identifier = digest or tag,
target_name = single_platform,
config = config,
# TODO(2.0): remove
config_path = config_path,
bazel_tags = bazel_tags,
)

Expand All @@ -227,6 +222,4 @@ def oci_pull(name, image = None, repository = None, registry = None, platforms =
bzlmod_repository = name if is_bzlmod else None,
reproducible = reproducible,
config = config,
# TODO(2.0): remove
config_path = config_path,
)

0 comments on commit dc2098a

Please sign in to comment.