Repository navigation
fix: honor helm-version when helmfile-auto-init is enabled - #819
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #816
Root cause
With
helmfile-auto-init: "true", the action ranhelmfile initwithout installing helm itself, so thehelm-versioninput was silently ignored.From helmfile's own init implementation (
pkg/app/init.go):helm version --client --short— the--clientflag was removed in helm v4 → init panics withunknown flag: --clienthelm-version: v3.20.1pin never took effectFix
Install helm with the requested
helm-versionbefore runninghelmfile init. Per the code above,helmfile initdetects the existing helm on PATH (viaexec.LookPath) and reuses it instead of downloading its own — so:helmfile v1.1.6+helm-version: v3.20.1+auto-init: truenow works: helm 3.20.1 is on PATH, init skips its own install,helm version --client --shortsucceedsauto-init: falsepath is unchangedhelm-version: latest(default), the same latest version the action already installs forauto-init: falseis now also used forauto-init: trueAlso documents the behavior in the README.
Testing
npm run build+npm run packagepass, dist regeneratedtest-action-auto-init(all 3 OS), which exercises the auto-init path end-to-end with helmfile latest + helm latest