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

Invalid semantic version #193

Closed
itssimon opened this issue Jul 10, 2020 · 8 comments
Closed

Invalid semantic version #193

itssimon opened this issue Jul 10, 2020 · 8 comments
Labels
Type: Bug Something isn't working

Comments

@itssimon
Copy link

Error: Failed to render chart: exit status 1: Error: template: aws-node-termination-handler/templates/daemonset.linux.yaml:23:9: executing "aws-node-termination-handler/templates/daemonset.linux.yaml" at <include "aws-node-termination-handler.nodeSelectorTermsOs" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:96:40: executing "aws-node-termination-handler.nodeSelectorTermsOs" at <include "aws-node-termination-handler.defaultNodeSelectorTermsOs" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:82:14: executing "aws-node-termination-handler.defaultNodeSelectorTermsOs" at <include "aws-node-termination-handler.defaultNodeSelectorTermsPrefix" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:75:8: executing "aws-node-termination-handler.defaultNodeSelectorTermsPrefix" at <semverCompare "<1.14" $k8sVersion>: error calling semverCompare: Invalid Semantic Version

This was introduced in #190.

@bwagner5
Copy link
Contributor

will look into this ASAP

@bwagner5 bwagner5 added the Type: Bug Something isn't working label Jul 10, 2020
@bwagner5
Copy link
Contributor

Can you share details about your environment? I'm trying to reproduce, but all e2e tests are passing and they use helm to install. I was able to manually install to an EKS cluster w/ the following version using helm3:

kubectl version
Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.11-eks-af3caf", GitCommit:"af3caf6136cd355f467083651cc1010a499f59b1", GitTreeState:"clean", BuildDate:"2020-03-27T21:51:36Z", GoVersion:"go1.12.17", Compiler:"gc", Platform:"linux/amd64"}

@itssimon
Copy link
Author

The error occurs during a helmfile apply operation, which internally uses the helm diff plugin. It's just in the latest chart version, the previous version 0.8.0 works fine.

kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.9", GitCommit:"a17149e1a189050796ced469dbd78d380f2ed5ef", GitTreeState:"clean", BuildDate:"2020-04-16T11:44:51Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.8-eks-e16311", GitCommit:"e163110a04dcb2f39c3325af96d019b4925419eb", GitTreeState:"clean", BuildDate:"2020-03-27T22:37:12Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
helm version       
version.BuildInfo{Version:"v3.2.4", GitCommit:"0ad800ef43d3b826f31a5ad8dfbb4fe05d143688", GitTreeState:"clean", GoVersion:"go1.13.12"}
helmfile --version
helmfile version v0.120.0

@fert-f
Copy link

fert-f commented Jul 10, 2020

Workaround is to use old chart version:
helm upgrade ... --set image.tag=v1.5.0 --version 0.8.0

@bwagner5
Copy link
Contributor

Thanks for the info, I was able to reproduce with the helm diff plugin:

$ helm diff upgrade aws-node-termination-handler ~/git/aws-node-termination-handler/config/helm/aws-node-termination-handler -n kube-system --debug

...
Error: template: aws-node-termination-handler/templates/daemonset.linux.yaml:23:9: executing "aws-node-termination-handler/templates/daemonset.linux.yaml" at <include "aws-node-termination-handler.nodeSelectorTermsOs" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:96:40: executing "aws-node-termination-handler.nodeSelectorTermsOs" at <include "aws-node-termination-handler.defaultNodeSelectorTermsOs" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:82:14: executing "aws-node-termination-handler.defaultNodeSelectorTermsOs" at <include "aws-node-termination-handler.defaultNodeSelectorTermsPrefix" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:75:8: executing "aws-node-termination-handler.defaultNodeSelectorTermsPrefix" at <semverCompare "<1.14" $k8sVersion>: error calling semverCompare: Invalid Semantic Version
helm.go:84: [debug] template: aws-node-termination-handler/templates/daemonset.linux.yaml:23:9: executing "aws-node-termination-handler/templates/daemonset.linux.yaml" at <include "aws-node-termination-handler.nodeSelectorTermsOs" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:96:40: executing "aws-node-termination-handler.nodeSelectorTermsOs" at <include "aws-node-termination-handler.defaultNodeSelectorTermsOs" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:82:14: executing "aws-node-termination-handler.defaultNodeSelectorTermsOs" at <include "aws-node-termination-handler.defaultNodeSelectorTermsPrefix" .>: error calling include: template: aws-node-termination-handler/templates/_helpers.tpl:75:8: executing "aws-node-termination-handler.defaultNodeSelectorTermsPrefix" at <semverCompare "<1.14" $k8sVersion>: error calling semverCompare: Invalid Semantic Version

@bwagner5
Copy link
Contributor

PR is up for a patch. Turns out EKS Minor versions have a "+" in them.

@bwagner5
Copy link
Contributor

eks-charts has been released

@TBBle
Copy link

TBBle commented Jul 19, 2020

I just saw this. Kubernetes Major/Minor versions are not SemVer, so semverCompare is the wrong function to use here.

The correct field to check with semverCompare is .Capabilities.KubeVersion.Version (GitVersion upstream, and formerly known as .Capabilities.KubeVersion.GitVersion in Helm v2), although you have to check against 1.14.0-0 (i.e. accept any 1.14 pre-release) because EKS claims to be a prerelease itself.

You can see exactly this use-case in Helm's own default template.

And I've just noticed that #190 introduced this by moving away from that format. I think it was the wrong change, it should have just switched Version to be GitVersion.

@snay2 snay2 removed the Pending-Release Pending an NTH or eks-charts release label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants