Commit Graph

6 Commits

Author SHA1 Message Date
Copilot c57134cda7
Fix helmfile init failing to update outdated helm plugins with Helm v4 (#2554)
* Initial plan

* Fix helmfile init not updating outdated helm plugins with Helm v4

- UpdatePlugin now handles secrets plugin with Helm 4 by using the split
  plugin architecture (uninstall old + install via installHelmSecretsV4)
- UpdatePlugin falls back to uninstall + reinstall when helm plugin update
  fails (e.g., with Helm 4 or tarball-installed plugins)
- Fix string-based semver comparison for helm-secrets version check in
  both AddPlugin and UpdatePlugin using proper semver comparison
- Add helmSecretsRequiresSplitInstall helper for reuse and correctness
- Add tests for update failure fallback scenarios

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/533f1b1c-dda6-4934-af27-051e4eaa9927

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* Address reviewer feedback: preserve update error context and add version assertions in tests

- exec.go: include original update error in fallback log message; wrap both
  errors (update + reinstall) when reinstall also fails so callers get full context
- init_test.go: add semver import and GetPluginVersion assertions after
  CheckHelmPlugins to verify plugins are at required versions on disk

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/c784db7d-7d4c-40a0-97f0-a31eb8901cd6

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* Address second round of reviewer feedback

- exec.go: rename UpdatePlugin parameter path→repo for clarity
- exec.go: fix uninstallPlugin to only emit INFO log when err == nil
- exec_test.go: add Test_helmSecretsRequiresSplitInstall table-driven tests
  covering v4.6.9, v4.7.0, v4.8.0, v4.10.0, pre-release, invalid and empty
- exec_test.go: add Test_UpdatePlugin_Helm4SecretsUsesUninstallReinstall
  verifying that Helm 4 + secrets uses uninstall+reinstall (not plugin update)

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/cbd3f8c9-ec7d-4500-b168-cb1c2f7c87bc

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* Add len(args) >= 3 guards in test mock for plugin update/uninstall cases

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/ea0f5afc-d52d-473b-b759-853a8f841a26

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* Return early with combined error when uninstall fails in UpdatePlugin fallback

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/bb9a675c-309d-4b06-83d4-a6fe078dce64

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
2026-04-25 11:04:23 +08:00
Aditya Menon 3dab01c16f
fix: prevent panic in helmfile init on plugin install errors (#2401)
toCLIError() panics on unhandled error types (e.g. helmexec.ExitError
from a failed helm plugin install). On Windows, plugin install hooks
often fail due to missing 'sh', causing helmfile init to crash even
when the plugin binary was placed correctly.

- Add helmexec.ExitError case to toCLIError and replace panic in the
  default case with a graceful error return
- After AddPlugin/UpdatePlugin errors, verify whether the plugin is
  actually present before failing; log a warning and continue if so

Fixes #1983

Signed-off-by: Aditya Menon <amenon@canarytechnologies.com>
2026-02-18 08:57:11 +08:00
Zubair Haque 61439fbc34
chore: improve test assertions and descriptions for file download test (#1745)
improve test assertions and descriptions for file download test

Signed-off-by: zhaque44 <haque.zubair@gmail.com>
2024-10-19 20:52:01 +08:00
yxxhero 67ab08ab5e
fix: oci pull directory conflict when download twice (#914)
* fix: oci pull directory conflict when download twice

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

* add test cases
2023-07-23 21:10:03 +08:00
yxxhero 36c91c5427
optimize lint logic (#586)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-18 08:39:45 +08:00
xiaomudk 6dcde20d7a
Add subcommand init for checks and installs helmfile deps (#389)
* Add subcommand init for checks and installs helmfile deps

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2022-11-03 14:51:30 +08:00