Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semver incorrectly compares versions with eks #12053

Closed
drewwells opened this issue May 4, 2023 · 3 comments
Closed

semver incorrectly compares versions with eks #12053

drewwells opened this issue May 4, 2023 · 3 comments

Comments

@drewwells
Copy link

Input:

  annotations:
    compare: {{ semverCompare ">=1.21" "1.25.8-eks-ec5523e" | quote }} #>=1.21 1.25.8-eks-ec5523e
    compare: {{ semverCompare ">=1.21" "1.25.8" | quote }} #>=1.21 1.25.8

Output:

  annotations:
    compare: "false" #>=1.21 1.25.8-eks-ec5523e
    compare: "true" #>=1.21 1.25.8

Expected:

  annotations:
    compare: "true" #>=1.21 1.25.8-eks-ec5523e
    compare: "true" #>=1.21 1.25.8

Output of helm version:
version.BuildInfo{Version:"v3.11.3", GitCommit:"323249351482b3bbfc9f5004f65d400aa70f9ae7", GitTreeState:"clean", GoVersion:"go1.20.3"}
Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:36:36Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25+", GitVersion:"v1.25.8-eks-ec5523e", GitCommit:"83fe90de881ffe7450876d204ccdc37a0f95bda3", GitTreeState:"clean", BuildDate:"2023-03-20T21:32:06Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):
aws eks

@drewwells
Copy link
Author

drewwells commented May 4, 2023

Tracked it down in sprig to this validate error
1.25.8-eks-ec5523e is a prerelease version and the constraint is only looking for release versions

The following version will match eks's selfreported prerelease versioning >=1.21-0

@gjenkins8
Copy link
Contributor

Yes, semver comparison doesn't match pre-release versions (by default; for the obvious reasons). EKS is (incorrectly?) using -eks-ec5523e to indicate an internal release version. Which is poor/incorrect semver form.

@drewwells
Copy link
Author

I found the validate calls in sprig to verify the reasons. Above comment is correct, this is a semver for released versions. It's correct in failing the semverCompare

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

No branches or pull requests

2 participants