Skip to content

Commit

Permalink
chart: fix ovs-ovn update strategy (#3887)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian authored Apr 3, 2024
1 parent a48c597 commit b7a2c0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions charts/kube-ovn/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ version: 1.13.0
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.13.0"

kubeVersion: ">= 1.23.0"
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 and (ne $newChartVersion $chartVersion) (regexMatch $versionRegex $imageVersion) -}}
{{- if regexFind $versionRegex $imageVersion | semverCompare ">= 1.12.0" -}}
RollingUpdate
{{- else -}}
Expand Down

0 comments on commit b7a2c0a

Please sign in to comment.