Skip to content
Open
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
63 changes: 63 additions & 0 deletions docs/topics/charts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,69 @@ charts/
mysql-3.2.1.tgz
```

#### The Chart.lock file and content digests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #32243 adds the per-dependency digest field to Chart.lock. The Dependency.Digest field (pkg/chart/v2/dependency.go) carries the sha256: archive hash and is omitempty/omitted from Chart.yaml; the top-level Lock.Digest continues to hash only Chart.yaml constraints + resolved metadata, excluding per-dependency content digests (internal/resolver/resolver.go HashReq).

Source: helm/helm#32243


When `helm dependency update` resolves and downloads your dependencies, it
records the result in a `Chart.lock` file alongside `Chart.yaml`. The lock file
pins the exact name, version, and repository of every resolved dependency, so
that later builds reproduce the same set of charts.

Each dependency entry in `Chart.lock` also includes a `digest` field, which is
the `sha256:` hash of the downloaded chart archive's bytes.

```yaml
dependencies:
- name: apache
version: 1.2.3
repository: https://example.com/charts
digest: sha256:1b5fa1...
- name: mysql
version: 3.2.1
repository: https://another.example.com/charts
digest: sha256:9a0c4e...
digest: sha256:abc...
generated: "2026-06-19T00:00:00Z"
```

There are two distinct digests, and they track different things:

- The top-level `digest` hashes the dependency constraints in `Chart.yaml`
together with the resolved metadata (name, version, and repository). It
detects drift between `Chart.yaml` and `Chart.lock`, for example when you
change a version constraint but do not re-run `helm dependency update`.
- The per-dependency `digest` records the exact tarball content that was
downloaded. It is written only to `Chart.lock`, and is omitted from the
dependency entries in `Chart.yaml`.

When you run `helm dependency build`, Helm rebuilds the `charts/` directory from
`Chart.lock` and checks each dependency against its recorded per-dependency
`digest`. If a chart repository republishes the same version with different
archive bytes, the content no longer matches the recorded digest and `helm
dependency build` fails:

```text
chart.lock digest mismatch for apache-1.2.3: expected sha256:..., got sha256:...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fatal chart.lock digest mismatch for <name>-<version>: expected ..., got ... error text comes verbatim from recordDependencyDigest in pkg/downloader/digest.go; it fires on helm dependency build because downloadAll receives the lock's pre-populated dep.Digest. Re-running helm dependency update re-records the digest (empty dep.Digest on the resolve path), confirmed by TestContentDigestUpdateOnRepublish.

Source: helm/helm#32243

```

Because the per-dependency content digest is tracked separately from the
top-level digest, republishing an identical version with different bytes changes
only the per-dependency digest and leaves the top-level digest untouched. To
re-lock against the new content, run `helm dependency update` again.

A `Chart.lock` written by an older version of Helm that does not record
per-dependency digests still builds without error. The digests are added the
next time you run `helm dependency update`.

Separately, while downloading any dependency, Helm compares the digest
advertised in the chart repository's index against the bytes it actually
downloaded. If the two do not match, Helm prints a warning to standard error:

```text
WARNING: digest mismatch for <chart>: repository index has sha256:..., downloaded content has sha256:...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-fatal WARNING: digest mismatch for <ref>: repository index has sha256:..., downloaded content has sha256:... text and its informational (non-blocking) behavior come from verifyDownloadedDigest in pkg/downloader/chart_downloader.go, which only warns and still writes the chart. Legacy Chart.lock without digests building without error is confirmed by TestLegacyLockWithoutDigest.

Source: helm/helm#32243

```

This warning is informational and does not stop the operation.

#### Alias field in dependencies

In addition to the other fields above, each requirements entry may contain the
Expand Down
Loading