Safeguard
Developer Tools•

Helm Chart.lock: keep chart dependencies the same in every cluster

Helm dependency build rebuilds charts from Chart.lock without renegotiating versions, which keeps dev, staging, and prod clusters on the same subcharts.

Safeguard Security Team
3 min read

Commit Chart.lock and use helm dependency build in your pipeline. It reconstructs the charts directory to the exact state in the lock file, without renegotiating versions. helm dependency update re-resolves, which is how two clusters end up with different subcharts.

Two commands, two behaviors

The Helm documentation describes helm dependency build as building out the charts directory from the Chart.lock file. It reconstructs a chart's dependencies to the state specified in the lock file, and it does not re-negotiate dependencies the way helm dependency update does. One detail matters: if no lock file is found, build mirrors the behavior of update.

So a missing lock file turns a safe command into an unsafe one without any warning. Keep the file in version control.

Why this matters across environments

A chart often declares dependencies by version range. If dev runs update on Monday and prod's pipeline runs update on Friday, a newer subchart release can slip into prod. That subchart can ship its own container images, defaults, and templates. You tested one combination and deployed another.

CommandReads lock fileChanges versions
helm dependency updateRe-resolves from Chart.yamlYes, within ranges
helm dependency buildYesNo

A pipeline recipe

  1. A developer changes Chart.yaml dependencies and runs update locally.
  2. They commit both Chart.yaml and Chart.lock in the same pull request.
  3. Reviewers read the lock diff, just as they would for a package lockfile.
  4. CI and every deploy job run build, never update.
  5. Fail the job if Chart.lock is missing.

Verify what the chart brings in

The lock file tracks chart versions. It does not tell you which container images those charts deploy. After rendering, list the image references and record their digests. A subchart upgrade can change an image without any change in your own values. See Docker tag or digest for pinning those.

Build also has verification flags. The docs list a verify option that checks packages against signatures, along with a keyring option. If your chart sources publish signatures, using it adds integrity to consistency.

What to review in a lock diff

  • A version bump for any subchart, especially a major one.
  • A changed repository URL. Treat that as a change of trust.
  • A changed digest value, if present, with no version change.

Rehearse it once

Run a quick experiment in a scratch directory. Run update, commit the lock, then delete the charts directory and run build. Confirm the versions are unchanged. Then remove the lock file and run build again, and watch it behave like update. Seeing the difference once makes the rule easy to enforce in review.

Teams that deploy the same chart to several clusters should also record which Chart.lock revision each cluster runs. A short table in your release notes is enough, and it turns a vague question about subchart versions into a lookup.

What Safeguard does here

Safeguard scans container images and dependency files, and tracks findings over time, which helps when a chart upgrade changes what runs in a cluster. Try the free scan at gold.safeguard.sh/scan.

Quick check

Should Chart.lock be committed?

Yes for applications you deploy. It is the record that makes builds repeatable.

Does Chart.lock pin container images?

No. It pins chart dependencies. Pin images separately by digest.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.