helmfile/pkg/app
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 fix: pass --timeout flag through to helm for sync and apply (#2495) 2026-03-22 07:34:33 +08:00
version feat: optimize version output (#412) 2022-10-08 14:26:15 +09:00
app.go fix: remove naked return by returning expected values (#2617) 2026-06-01 20:51:19 +08:00
app_apply_hooks_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
app_apply_nokubectx_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
app_apply_test.go fix: pass --timeout flag through to helm for sync and apply (#2495) 2026-03-22 07:34:33 +08:00
app_diff_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
app_gethelm_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
app_lint_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
app_list_test.go fix: helmfile list now reflects version from helmfile.lock (#2486) 2026-03-19 14:25:03 +08:00
app_parallel_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
app_sequential_test.go fix: use absolute baseDir in sequential helmfiles for correct values path resolution (#2425) 2026-02-26 07:47:39 +08:00
app_sync_test.go feat: show diff preview when sync --interactive is used (#2603) 2026-05-21 20:47:00 +08:00
app_template_test.go feat: add defaultInherit for automatic release template inheritance (#2600) 2026-05-20 18:21:03 +08:00
app_test.go fix: add trackFailOnError option to control kubedog exit code (#2576) 2026-05-04 14:20:03 +08:00
app_unittest_test.go feat: add `helmfile unittest` command for helm-unittest integration (#2400) 2026-02-16 09:45:10 +08:00
ask.go build(deps): bump golangci/golangci-lint-action from 6 to 7 (#1975) 2025-03-28 07:52:06 +08:00
cleanup_hooks_error_test.go fix: cleanup hooks not receiving error signal (#2475) 2026-03-21 14:29:32 +08:00
config.go fix: add trackFailOnError option to control kubedog exit code (#2576) 2026-05-04 14:20:03 +08:00
constants.go Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
constants_test.go fix lint error 2022-08-13 07:40:32 +08:00
context.go perf(app): Parallelize helmfile.d rendering and eliminate chdir race conditions (#2261) 2025-11-15 16:19:41 +08:00
context_test.go perf(app): Parallelize helmfile.d rendering and eliminate chdir race conditions (#2261) 2025-11-15 16:19:41 +08:00
create.go feat: add 'create' subcommand to scaffold helmfile deployment projects (#2574) 2026-05-03 19:03:11 +08:00
create_test.go feat: add 'create' subcommand to scaffold helmfile deployment projects (#2574) 2026-05-03 19:03:11 +08:00
dag_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
desired_state_file_loader.go feat(state): add mergeStrategy: fallback for first-file-wins env values (#2578) 2026-05-07 21:50:05 +08:00
destroy_nokubectx_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
destroy_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
diff_nokubectx_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
diff_test.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
errors.go feat: Opt-out dep-builds and repo-updates (#463) 2019-02-04 12:07:25 +09:00
errors_test.go add unittest for error.go in pkg/app 2022-04-28 09:01:02 +08:00
formatters.go 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
formatters_test.go cleanup: remove panic in testutil (#890) 2023-06-13 13:44:32 +08:00
init.go Bump Helm support to 4.2.1 and 3.21.1 (#2635) 2026-06-13 16:50:56 +08:00
init_test.go Fix helmfile init failing to update outdated helm plugins with Helm v4 (#2554) 2026-04-25 11:04:23 +08:00
load_opts.go fix: update state values files handling to replace arrays instead of merging (#2537) 2026-04-13 19:46:15 +08:00
load_opts_test.go fix: update state values files handling to replace arrays instead of merging (#2537) 2026-04-13 19:46:15 +08:00
print_env.go feat: add print-env command (#2279) 2025-11-28 08:46:37 +08:00
print_env_test.go feat: add print-env command (#2279) 2025-11-28 08:46:37 +08:00
run.go Expose internal apis (#2520) 2026-05-07 21:52:18 +08:00
snapshot_test.go Use log capturing helper in TestApply_hooks 2022-11-13 08:20:13 +00:00
two_pass_renderer.go build(deps): bump golangci/golangci-lint-action from 6 to 7 (#1975) 2025-03-28 07:52:06 +08:00
two_pass_renderer_test.go Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
validate_config.go add Go lint 2022-07-16 20:21:11 +08:00
validate_config_test.go add unittest for ValidateConfig 2022-04-27 07:38:22 +08:00