Repository navigation
test: cover disableAutoDetectedKubeVersionForDiff precedence in diff flags - #2852
Merged
Merged
Conversation
…flags TestHelmState_DiffFlags had no coverage for the disableAutoDetectedKubeVersionForDiff flag (issue helmfile#2848). Add six table-driven cases covering both declaration sites (release-level and helmDefaults) and the precedence when both are set: with the flag on, an explicit release- or top-level kubeVersion is passed to helm-diff instead of the detected one; release-level false overrides helmDefaults true; and no configured kubeVersion passes no --kube-version flag at all. Also document the release-kubeVersion precedence in docs/configuration.md. Closes helmfile#2848 Signed-off-by: yxxhero <[email protected]>
yxxhero
requested review from
aditmeno,
itscaro,
mumoshu,
xiaomudk and
zhaque44
as code owners
October 24, 2026 02:41
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused test and documentation changes match the existing precedence behavior, with no unresolved findings.
No open issues 🎉
What changed in this PR
Adds regression coverage for Helmfile’s diff kube-version precedence, addressing #2848 without changing runtime behavior.
Changes:
- Adds six table-driven cases covering release-level and
helmDefaultsdisable settings, configured-version fallbacks, and release overrides. - Documents that a release-level
kubeVersiontakes precedence over the auto-detected version for diff.
| File | Description |
|---|---|
pkg/state/state_test.go |
Extends diff-flag tests with disable-setting precedence cases and top-level kube-version inputs. |
docs/configuration.md |
Clarifies release-level kube-version precedence for diff. |
Review effort: Balanced
xiaomudk
approved these changes
Oct 27, 2026
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.
Closes #2848
Problem
disableAutoDetectedKubeVersionForDiffhad zero test coverage anywhere in the repo, even though it controls which--kube-versionhelm-diff receives.Solution
Extend
TestHelmState_DiffFlagswith six table-driven cases covering both declaration sites and their interaction:--kube-version--kube-versionAlso document in
docs/configuration.mdthat a release-levelkubeVersiontakes precedence over the auto-detected cluster version forhelm diff.Verification
go test ./pkg/state/ -run 'TestHelmState_DiffFlags' -race -p=1— 13/13 subtests passgofmtclean; targetedgo buildclean