helm_oci_manifest macro.

Functions

helm_oci_manifest

load("@rules_helm_img//:helm_oci_manifest.bzl", "helm_oci_manifest")

helm_oci_manifest(*, name, chart, registry_url, registry_url_file, visibility, **kwargs)

Describe a chart as the OCI artifact helm push creates, for rules_img's multi_deploy.

The target is an image_manifest that provides DeployInfo, so it can be listed in the operations of a multi_deploy. Running the multi_deploy pushes the chart to <registry_url>/<chart name>:<chart version>, with + in the version replaced by _, as helm push would. Only the chart is pushed; push its images with their own targets.

load("@rules_helm_img//:defs.bzl", "helm_oci_manifest")
load("@rules_img//img:multi_deploy.bzl", "multi_deploy")

helm_oci_manifest(
    name = "my_chart_oci_manifest",
    chart = ":my_chart",
    registry_url = "oci://registry.example.com/charts",
)

multi_deploy(
    name = "deploy",
    operations = [":my_chart_oci_manifest"],
)

The pushed manifest is the one helm push creates when it runs in UTC, so its digest is the one helm_oci_digest gives. Helm writes the org.opencontainers.image.created annotation in the local time zone, so helm push in another zone pushes a different digest for the same chart.

Compared with helm_push:

  • Only oci:// registries are supported, so push_cmd and plugins such as cm-push are not.
  • Registry credentials come from rules_img (Docker config and credential helpers), not from the HELM_REGISTRY_* variables (HELM_REGISTRY_USERNAME, HELM_REGISTRY_PASSWORD and HELM_REGISTRY_PASSWORD_FILE).
  • There is no include_images.

rules_img expands Go templates in annotation values. {{ in a chart's metadata is escaped, so the annotations match the chart.

targetrule
{name}image_manifest
{name}.oci_digesthelm_oci_digest
{name}.filesconfig blob, annotations, tag, repository and layer files
{name}.layerlayer_from_file
{name}.push_specimage_push_spec

PARAMETERS

NameDescriptionDefault Value
nameThe name of the image_manifest target.none
chartA helm_chart or helm_package target. Charts from helm_import are not supported.none
registry_urlThe registry URL given to helm push, for example oci://registry.example.com/charts. Mutually exclusive with registry_url_file.None
registry_url_fileA file containing the registry URL. Mutually exclusive with registry_url.None
visibilityThe visibility of {name}. The other targets are private.None
kwargsCommon attributes such as tags, target_compatible_with and testonly, applied to every target.none