Skip to content

Commit

Permalink
chart: fix ovs-ovn update strategy
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
  • Loading branch information
zhangzujian committed Mar 29, 2024
1 parent 31968e8 commit 17a4e69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion charts/kube-ovn/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ Number of master nodes
{{- if eq $ds.spec.updateStrategy.type "RollingUpdate" -}}
RollingUpdate
{{- else -}}
{{- $chartVersion := index $ds.metadata.annotations "chart-version" }}
{{- $newChartVersion := printf "%s-%s" .Chart.Name .Chart.Version }}
{{- $imageVersion := (index $ds.spec.template.spec.containers 0).image | splitList ":" | last | trimPrefix "v" -}}
{{- $versionRegex := `^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)` -}}
{{- if regexMatch $versionRegex $imageVersion -}}
{{- if (ne $newChartVersion $chartVersion) and (regexMatch $versionRegex $imageVersion) -}}
{{- if regexFind $versionRegex $imageVersion | semverCompare ">= 1.12.0" -}}
RollingUpdate
{{- else -}}
Expand Down

0 comments on commit 17a4e69

Please sign in to comment.