fix: Update kubeVersion to allow pre-releases#842
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the kubeVersion in Chart.yaml to >=1.29.0-0 to support EKS pre-release versions. However, the reviewer points out that due to Helm's SemVer implementation, this constraint will only match pre-releases for version 1.29.0 and will fail for higher versions like 1.33.10-eks-xxx. It is recommended to remove the kubeVersion field to ensure compatibility across EKS versions.
| # Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
| version: "v0.9.1" # x-release-please-version | ||
| kubeVersion: ">=1.29.0" | ||
| kubeVersion: ">=1.29.0-0" |
There was a problem hiding this comment.
The proposed change kubeVersion: ">=1.29.0-0" does not achieve the goal of supporting EKS versions like v1.33.10-eks-bbe087e mentioned in the PR description.
Helm uses the Masterminds/semver library, which follows a strict rule for pre-releases: a range constraint will only match a pre-release version if the range itself includes a pre-release identifier and the major, minor, and patch versions match exactly.
Consequently:
>=1.29.0-0will match1.29.0-eks-xxx.>=1.29.0-0will not match1.29.1-eks-xxxor1.33.10-eks-xxxbecause the minor/patch versions differ.
Since EKS versions always include a pre-release suffix (e.g., -eks-xxx), they are always treated as pre-releases by Helm. This constraint will therefore block installations on any EKS cluster where the version is not exactly 1.29.0. To properly support EKS across multiple Kubernetes versions, the most common approach is to remove the kubeVersion field entirely, as Helm's SemVer implementation does not currently support a range that matches all pre-releases across different minor or patch versions.
There was a problem hiding this comment.
FTR I don't agree with this analysis. I've tested it, adding -0 does makes it accept 1.33.10-eks-xxx
There was a problem hiding this comment.
From the Masterminds/semver docs:
>=1.2.3 will skip pre-releases when looking at a list of releases while >=1.2.3-0 will evaluate and find pre-releases.
They have tests that seem to assert that this should fix your issue, and it seems other popular projects do similarly as well.
So, ya, I think the bot is wrong. 🤖
Signed-off-by: Karel Vervaeke <karel@vervaeke.info>
|
Would you have time to review this? If you disagree, I can join you on the CNCF slack to discuss this and see if there are better solutions / workarounds |
This PR
Makes helm accept pre-releases.
We're trying to upgrade from 0.8.9 to 0.9.1 on EKS (v1.33.10-eks-bbe087e). Unfortunately Helm's semver logic treats v1.33.10-eks-bbe087e as lower than 1.29.0 so we're stuck.
Related Issues
Notes
Alternative:
Unferified but IIUC Helm would accept v1.33.10+eks-bbe087e (+ instead of -). I don't think I'll be able to convince AWS of this though.
Follow-up Tasks
How to test
I guess the easiest way would be to try to install this on an EKS cluster.