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

version 2.7.0 doesn't check well unsemver version for pre 5.3.0 check #361

Open
sylvainOL opened this issue Jan 25, 2024 · 0 comments
Open

Comments

@sylvainOL
Copy link

new version of neuvector helm is supposed to work with version < 5.3.0

the check is the following:

{{- $pre530 := false -}}
{{- if regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" .tag }}
{{- $pre530 = (semverCompare "<5.2.10" $cleanVersion) -}}

with well semver formed version, it does work:
https://repeatit.io/#/share/eyJ0ZW1wbGF0ZSI6Int7LSAkcHJlNTMwIDo9IGZhbHNlIC19fVxue3stIGlmIHJlZ2V4TWF0Y2ggXCJeWzAtOV0rXFxcXC5bMC05XStcXFxcLlswLTldK1wiIC50YWcgfX1cbnt7LSAkcHJlNTMwID0gKHNlbXZlckNvbXBhcmUgXCI8NS4yLjEwXCIgLnRhZykgLX19XG57ey0gZW5kIH19XG57ey0gaWYgJHByZTUzMCB9fVxub2xkIHZlcnNpb25cbnt7LSBlbHNlIH19XG5uZXcgdmVyc2lvblxue3stIGVuZCB9fSIsImlucHV0IjoidGFnOiA1LjIuNCIsImNvbmZpZyI6eyJ0ZW1wbGF0ZSI6InRleHQiLCJmdWxsU2NyZWVuSFRNTCI6ZmFsc2UsImZ1bmN0aW9ucyI6WyJzcHJpZyJdLCJvcHRpb25zIjpbImxpdmUiXSwiaW5wdXRUeXBlIjoieWFtbCJ9fQ==

but with non semver version (like security patch one: 5.2.4-s1), it doesn't work and the charts use the >= 5.3.0 mode:

https://repeatit.io/#/share/eyJ0ZW1wbGF0ZSI6Int7LSAkcHJlNTMwIDo9IGZhbHNlIC19fVxue3stIGlmIHJlZ2V4TWF0Y2ggXCJeWzAtOV0rXFxcXC5bMC05XStcXFxcLlswLTldK1wiIC50YWcgfX1cbnt7LSAkcHJlNTMwID0gKHNlbXZlckNvbXBhcmUgXCI8NS4yLjEwXCIgLnRhZykgLX19XG57ey0gZW5kIH19XG57ey0gaWYgJHByZTUzMCB9fVxub2xkIHZlcnNpb25cbnt7LSBlbHNlIH19XG5uZXcgdmVyc2lvblxue3stIGVuZCB9fSIsImlucHV0IjoidGFnOiA1LjIuNC1zMSIsImNvbmZpZyI6eyJ0ZW1wbGF0ZSI6InRleHQiLCJmdWxsU2NyZWVuSFRNTCI6ZmFsc2UsImZ1bmN0aW9ucyI6WyJzcHJpZyJdLCJvcHRpb25zIjpbImxpdmUiXSwiaW5wdXRUeXBlIjoieWFtbCJ9fQ==

the check should "clean" the tag before doing the semverCompare:

{{- $pre530 := false -}}
{{- if regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" .tag }}
{{- $cleanVersion := regexFind "^[0-9]+\\.[0-9]+\\.[0-9]+" .tag }}
{{- $pre530 = (semverCompare "<5.2.10" $cleanVersion) -}}
sylvainOL added a commit to sylvainOL/neuvector-helm that referenced this issue Jan 25, 2024
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

Successfully merging a pull request may close this issue.

1 participant