Skip to content

fix: honor helm-version when helmfile-auto-init is enabled - #819

Merged
yxxhero merged 1 commit into
mainfrom
fix/816-auto-init-helm-version
Nov 14, 2026
Merged

yxxhero merged 1 commit into
mainfrom
fix/816-auto-init-helm-version

Conversation

@yxxhero

@yxxhero yxxhero commented Nov 14, 2026

Copy link
Copy Markdown
Member

Fixes #816

Root cause

With helmfile-auto-init: "true", the action ran helmfile init without installing helm itself, so the helm-version input was silently ignored.

From helmfile's own init implementation (pkg/app/init.go):

_, err := exec.LookPath(h.helmBinary)
if !helmExits { h.InstallHelm() }          // only when helm is NOT on PATH
helmversion, err := helmexec.GetHelmVersion(...) // `helm version --client --short`
  • On a clean runner, helm is not on PATH → helmfile installs the latest helm, which is now helm v4
  • Older helmfile releases (e.g. v1.1.6 from the issue) probe the version with helm version --client --short — the --client flag was removed in helm v4 → init panics with unknown flag: --client
  • The user's helm-version: v3.20.1 pin never took effect

Fix

Install helm with the requested helm-version before running helmfile init. Per the code above, helmfile init detects the existing helm on PATH (via exec.LookPath) and reuses it instead of downloading its own — so:

  • helmfile v1.1.6 + helm-version: v3.20.1 + auto-init: true now works: helm 3.20.1 is on PATH, init skips its own install, helm version --client --short succeeds
  • the auto-init: false path is unchanged
  • with helm-version: latest (default), the same latest version the action already installs for auto-init: false is now also used for auto-init: true

Also documents the behavior in the README.

Testing

  • npm run build + npm run package pass, dist regenerated
  • CI — including test-action-auto-init (all 3 OS), which exercises the auto-init path end-to-end with helmfile latest + helm latest

With helmfile-auto-init: true the action ran 'helmfile init' without
installing helm itself, so the helm-version input was silently ignored.
helmfile init only installs helm when none is found on PATH, and it
always takes the latest release — which is now helm v4. Older helmfile
releases are incompatible with helm v4 (e.g. 'helm version --client'
was removed in v4), so init panicked with 'unknown flag: --client'.

Install helm with the requested version before running helmfile init so
it detects the binary on PATH and reuses it, keeping the user's pin
effective (e.g. helmfile v1.1.6 + helm v3.20.1 now works).

Fixes #816

Signed-off-by: yxxhero <[email protected]>
@yxxhero
yxxhero merged commit 62818df into main Nov 14, 2026
12 checks passed
@yxxhero
yxxhero deleted the fix/816-auto-init-helm-version branch November 14, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: unknown flag: --client

1 participant