Skip to content

Commit

Permalink
Fix version check with non semver versions
Browse files Browse the repository at this point in the history
closes neuvector#361

Signed-off-by: Sylvain Desbureaux <[email protected]>
  • Loading branch information
sylvainOL committed Jan 25, 2024
1 parent 266cad5 commit 0c390f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion charts/core/templates/enforcer-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- $pre530 := false -}}
{{- if regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" .Values.tag }}
{{- $pre530 = (semverCompare "<5.2.10" .Values.tag) -}}
{{- $semVerVersion := regexFind "^[0-9]+\\.[0-9]+\\.[0-9]+" .Values.tag }}
{{- $pre530 = (semverCompare "<5.2.10" $semVerVersion) -}}
{{- end }}
{{- $runtimePath := "" -}}
{{- if .Values.runtimePath }}
Expand Down
2 changes: 1 addition & 1 deletion test/daemonset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestEnforcerDaemonsetRuntimePre53(t *testing.T) {

options := &helm.Options{
SetValues: map[string]string{
"tag": "5.2.0",
"tag": "5.2.0-s1",
"crio.enabled": "true",
"crio.path": "/var/run/crio.sock",
},
Expand Down

0 comments on commit 0c390f7

Please sign in to comment.