Skip to content
Merged
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
24 changes: 23 additions & 1 deletion helm/private/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _helm_toolchain_repository_impl(repository_ctx):
repository_ctx.name,
))

return {
attrs_for_reproducibility = {
"integrity": results.integrity,
"name": repository_ctx.name,
"platform": repository_ctx.attr.platform,
Expand All @@ -70,6 +70,16 @@ def _helm_toolchain_repository_impl(repository_ctx):
"urls": repository_ctx.attr.urls,
}

# Bazel <8.3.0 lacks repository_ctx.repo_metadata
if not hasattr(repository_ctx, "repo_metadata"):
return attrs_for_reproducibility

reproducible = repository_ctx.attr.integrity != ""
return repository_ctx.repo_metadata(
reproducible = reproducible,
attrs_for_reproducibility = {} if reproducible else attrs_for_reproducibility,
)

helm_toolchain_repository = repository_rule(
implementation = _helm_toolchain_repository_impl,
doc = "A repository rule for generating a Helm toolchain definition",
Expand Down Expand Up @@ -148,6 +158,12 @@ def _helm_plugin_repository_impl(repository_ctx):
repository_ctx.name,
))

# Bazel <8.3.0 lacks repository_ctx.repo_metadata
if not hasattr(repository_ctx, "repo_metadata"):
return None

return repository_ctx.repo_metadata(reproducible = repository_ctx.attr.integrity != "")

helm_plugin_repository = repository_rule(
implementation = _helm_plugin_repository_impl,
doc = "A repository rule for downloading a Helm plugin and generating a helm_plugin target.",
Expand Down Expand Up @@ -303,6 +319,12 @@ def _helm_toolchain_repository_hub_impl(repository_ctx):
toolchain_type = str(repository_ctx.attr.toolchain_type),
))

# Bazel <8.3.0 lacks repository_ctx.repo_metadata
if not hasattr(repository_ctx, "repo_metadata"):
return None

return repository_ctx.repo_metadata(reproducible = True)

helm_toolchain_repository_hub = repository_rule(
doc = (
"Generates a toolchain-bearing repository that declares a set of other toolchains from other " +
Expand Down
Loading