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, sopush_cmdand plugins such ascm-pushare not. - Registry credentials come from
rules_img(Docker config and credential helpers), not from theHELM_REGISTRY_*variables (HELM_REGISTRY_USERNAME,HELM_REGISTRY_PASSWORDandHELM_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.
| target | rule |
|---|---|
{name} | image_manifest |
{name}.oci_digest | helm_oci_digest |
{name}.files | config blob, annotations, tag, repository and layer files |
{name}.layer | layer_from_file |
{name}.push_spec | image_push_spec |
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| name | The name of the image_manifest target. | none |
| chart | A helm_chart or helm_package target. Charts from helm_import are not supported. | none |
| registry_url | The registry URL given to helm push, for example oci://registry.example.com/charts. Mutually exclusive with registry_url_file. | None |
| registry_url_file | A file containing the registry URL. Mutually exclusive with registry_url. | None |
| visibility | The visibility of {name}. The other targets are private. | None |
| kwargs | Common attributes such as tags, target_compatible_with and testonly, applied to every target. | none |