helm_oci_digest rules.

Rules

Providers

helm_oci_digest

load("@rules_helm//helm:helm_oci_digest.bzl", "helm_oci_digest")

helm_oci_digest(name, chart, registry_url, registry_url_file)

Compute the OCI manifest digest for a Helm chart at build time.

This rule constructs the OCI manifest that helm push (Helm v4) would create and computes its sha256 digest. The creation annotation comes from the chart's own org.opencontainers.image.created annotation, resolved by the stamping pass, and is formatted in UTC to match the push side.

The digest file contains a single line: sha256:<hex>.

The manifest and config blobs are also emitted, so a pusher that uploads them itself can PUT the exact bytes this digest was computed over. The manifest annotations and the tag are emitted for a pusher that builds the manifest itself. With registry_url or registry_url_file, so is the repository helm push would push to. None of these are in the default outputs; read them off HelmOCIDigestInfo or its output groups.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
chartA helm_chart target providing HelmPackageInfo.Labelrequired
registry_urlThe registry URL given to helm push, for example oci://registry.example.com/charts. Sets HelmOCIDigestInfo.repository. Only oci:// URLs are accepted; any other scheme fails the target, digest included. Mutually exclusive with registry_url_file.Stringoptional""
registry_url_fileA file containing the registry URL given to helm push. Sets HelmOCIDigestInfo.repository. As with registry_url, only oci:// URLs are accepted. Mutually exclusive with registry_url.LabeloptionalNone

HelmOCIDigestInfo

load("@rules_helm//helm:helm_oci_digest.bzl", "HelmOCIDigestInfo")

HelmOCIDigestInfo(annotations, config, digest, manifest, repository, tag)

OCI manifest digest for a Helm chart, computed at build time.

FIELDS

NameDescription
annotationsFile: The manifest annotations, as a JSON object of strings
configFile: The raw OCI config blob (application/vnd.cncf.helm.config.v1+json)
digestFile: Text file containing the OCI manifest digest (sha256:...)
manifestFile: The raw OCI manifest bytes whose digest is in digest
repositoryFile: <registry>/<repository> that helm push pushes to, or None when no registry URL is set
tagFile: The tag helm push uses, which is the chart version with + replaced by _