helmfile/test/e2e/template/helmfile
Copilot 655399a03b
Bump Helm support to 4.2.1 and 3.21.1 (#2635)
* chore: bump helm release pins

* chore: align helm module metadata

* chore: finalize helm patch bumps

* fix: add --plain-http flag for Helm 3.21+ OCI push in tests

Helm 3.21.1 introduced stricter security checks that reject HTTP
scheme downgrades when pushing to OCI registries, with the error:
  "blob upload Location downgrades scheme from https"

Previously only Helm 4 required --plain-http for HTTP-only OCI
registries. Now Helm 3.21+ also requires this flag.

Add a new requiresPlainHTTPForOCI() helper that returns true for
both Helm 4.x and Helm 3.21+, and use it in execHelmPush() instead
of isHelm4().

* fix: safe fallback in requiresPlainHTTPForOCI when version detection fails

Default to true (require --plain-http) when helm version detection
fails, since any Helm version that supports helm push also supports
the --plain-http flag. This avoids the inconsistent HELMFILE_HELM4
env var fallback which only covered Helm 4.

* fix: update snapshot tests for Helm 4.2.1 OCI pull output

Helm 4.2.1 now outputs additional 'Pulled:' and 'Digest: sha256:...'
lines after each OCI chart pull. The SHA256 digest is non-deterministic
because helm packages include build timestamps, so normalize it with
a regex placeholder.

- Add ociDigestRegex to normalize non-deterministic OCI digest values
- Create output-helm4.yaml for 5 tests that lacked Helm 4 snapshots
- Update output-helm4.yaml for oci_need and postrenderer to include
  the new Pulled/Digest lines from Helm dependency pull operations

* fix: update ociDigestRegex to match empty digest in Helm 4.2.1 OCI pull output

Helm 4.2.1 outputs "Digest: sha256:" (empty hash) when pulling OCI charts.
The regex required at least one hex char ([0-9a-f]+), so it did not match
and the digest was not normalized to $DIGEST in snapshot tests.

Also fix the replacement string: Go regex ReplaceAllString interprets $DIGEST
as a capture group reference (resolving to empty). Use $$DIGEST to produce
a literal $DIGEST in the output.

Signed-off-by: yxxhero <aiopsclub@163.com>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2026-06-13 16:50:56 +08:00
..
testdata Bump Helm support to 4.2.1 and 3.21.1 (#2635) 2026-06-13 16:50:56 +08:00
.gitignore feat: add duration to failed releases summary (#1066) 2023-10-12 18:49:07 -05:00
README.md Add integration test with local oci repo 2022-07-18 13:43:01 +00:00
snapshot_test.go Bump Helm support to 4.2.1 and 3.21.1 (#2635) 2026-06-13 16:50:56 +08:00
tmpl_test.go Replace interface{} by any (#901) 2023-06-16 10:49:05 +09:00

README.md

This directory contains a set of Go test source and testdata to test the helmfile template's rendering result by calling helmfile build or helmfile template on test input and comparing the output against the snapshot.

The testdata directory is composed of:

  • charts: The Helm charts used from within test helmfile configs (snapshpt/*/input.yaml) as local charts and remote charts
  • snapshot/$NAME/input.yaml: The input helmfile config for the test case of $NAME
  • snapshot/$NAME/output.yaml: The expected output of the helmfile command
  • snapshot/$NAME/config.yaml: The snapshot test configuration file. See the Config struct defined in snapshot_test.go for more information