Repository navigation
fix: correct LDFLAGS path for default Kubernetes version - #31512
Merged
Merged
Conversation
The Makefile LDFLAGS were pointing to an incorrect package path (helm.sh/helm/v4/pkg/chart/common/util) that doesn't exist, causing the k8sVersionMajor and k8sVersionMinor variables to silently fail to be set. This left the hardcoded defaults (1.20) in place. After this fix, `helm template` now correctly defaults to Kubernetes v1.34.0 (matching the bundled client-go version) instead of v1.20.0, ensuring charts render with current stable API versions. Testing scenario: ```sh cat > /tmp/test-chart/Chart.yaml << 'EOF' apiVersion: v2 name: test-chart version: 1.0.0 kubeVersion: ">= 1.28.0-0" EOF ./bin/helm template test-release /tmp/test-chart cat > /tmp/test-chart-fail/Chart.yaml << 'EOF' apiVersion: v2 name: test-chart-fail version: 1.0.0 kubeVersion: ">= 1.35.0-0" EOF ./bin/helm template test-release /tmp/test-chart-fail Exit code 1 Error: chart requires kubeVersion: >= 1.35.0-0 which is incompatible with Kubernetes v1.34.0 ``` Fixes helm#31508 Closes helm#31501 Closes helm#31502 Signed-off-by: Benoit Tigeot <[email protected]>
3 tasks
gjenkins8
approved these changes
Nov 15, 2025
|
Can we get a patch release with this fix please? This is a big regression. |
15 tasks done
1 task
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.
What this PR does / why we need it:
The Makefile LDFLAGS were pointing to an incorrect package path (helm.sh/helm/v4/pkg/chart/common/util) where variables don't exist, causing the
k8sVersionMajorandk8sVersionMinorvariables to silently fail to be set. This left the hardcoded defaults (1.20 fromcapabilities.go) in place.After this fix,
helm templatefor example now correctly defaults to Kubernetes v1.34.0 (matching the bundled client-go version) instead of v1.20.0, ensuring charts render with current stable API versions.Testing scenario:
Fixes #31508
Closes #31501
Closes #31502
Special notes for your reviewer:
If applicable:
docs neededlabel should be applied if so)