# Helm<no value>
// <!-- Required for asciidoctor -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
:toclevels: 4

== Description

The helm crawler looks recursively for all Helm charts from a specific root directory. A directory is treated as a chart root when it contains a `Chart.yaml` or `Chart.yml` file.

For each chart it performs two independent kinds of update:

* **Chart dependencies** declared in `Chart.yaml`. Disable with `ignorechartdependency: true`.
* **Container images** declared in `values.yaml` or `values.yml`. Disable with `ignorecontainer: true`.

This crawler is enabled by default, so it can be used either automatically by running `updatecli diff` from a directory containing the files to update, or by providing a manifest.
The automatic discovery behavior can be tuned by providing a YAML manifest with a `helm` crawler in top-level directive `autodiscovery` as explained in the link:/docs/core/autodiscovery/#_parameters["Autodiscovery" page].

=== Container image patterns

Updatecli looks for the following patterns in the chart values, where `registry` is optional:

[source,yaml]
----
image:
  registry: ghcr.io
  repository: updatecli/updatecli
  tag: 0.37.0
----

or

[source,yaml]
----
images:
  backend:
      repository: ghcr.io/updatecli/updatemonitor
      tag: 0.1.0
  front:
      repository: ghcr.io/updatecli/updatemonitor-ui
      tag: 0.1.0
----

An image with no `tag` is assumed to be `latest`. An image with no `repository` is skipped. A digest already present in `repository`, such as `image@sha256:...`, is stripped before the lookup.

== Generated manifests

Both flavours write through the link:{{< ref "helm_chart" >}}[`helmchart`] target rather than editing files directly, so **a chart is repackaged whenever one of its dependencies or images is bumped**.

[cols="1,3",options=header]
|===
| Flavour | Manifest shape

| Chart dependency
| A `helmchart` source for the latest dependency version, link:{{< ref "yaml" >}}[`yaml`] conditions asserting the dependency name and repository still match, and a `helmchart` target writing `$.dependencies[i].version`.

| Container image
| A link:{{< ref "docker_image" >}}[`dockerimage`] source for the latest tag, `yaml` conditions asserting the registry and repository, and a `helmchart` target writing the tag. When digest pinning is enabled a link:{{< ref "docker_digest" >}}[`dockerdigest`] source is added and the digest is written too.
|===

Two parameters control what the target does to the chart itself:

* `skippackaging` - when `true`, the chart is not repackaged.
* `versionincrement` - how the chart's own version in `Chart.yaml` is bumped in response to the change. Accepts a comma-separated list of `none`, `major`, `minor`, `patch`. Empty by default, meaning the chart version is left alone.

=== Digest pinning

`digest` defaults to **true**, so image updates resolve and write an immutable digest alongside the tag. Set `digest: false` to track the tag only.

== Authentication

Use `auths` to reach private registries, keyed by registry URL without a scheme, accepting either a `token` or a `username`/`password` pair. When it is empty Updatecli falls back to the ambient OCI credentials, such as those written by `docker login`.

== Version filtering

If unspecified, the version filter defaults to kind `semver` with pattern `*`.

For container images the pattern is additionally narrowed per image, using the tag currently in the values file: an image on `0.37.0` is filtered with `>=0.37.0`, and a `tagfilter` regex derived from the shape of that tag is added so unrelated tag conventions are not considered.

More details on the link:/docs/core/versionfilter/["Version Filtering" page].

== Manifest
=== Parameters

{{< autodiscoveryparameters "helm" >}}

NOTE: `only` and `ignore` rules accept `path` (a chart path pattern that must match the whole path), `dependencies` (a map of dependency name to version), and `containers` (a map of image name to tag).

=== Example

[source,yaml]
----
# updatecli.d/default.yaml
{{<include "assets/code_example/docs/plugins/autodiscovery/helm/updatecli.d/default.yaml">}}
----
