File tree 3 files changed +21
-12
lines changed
charts/kube-ovn/templates
3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,9 @@ Number of master nodes
63
63
{ {- $imageVersion := (index $ds .spec.template.spec.containers 0).image | splitList " :" | last | trimPrefix " v" -} }
64
64
{ {- $versionRegex := `^(?P< major> 0|[1-9]\d*)\.(?P< minor> 0|[1-9]\d*)\.(?P< patch> 0|[1-9]\d*)` -} }
65
65
{ {- if and (ne $newChartVersion $chartVersion ) (regexMatch $versionRegex $imageVersion ) -} }
66
- { {- if regexFind $versionRegex $imageVersion | semverCompare " >= 1.13.0" -} }
67
- 24.03
68
- { {- else if regexFind $versionRegex $imageVersion | semverCompare " >= 1.12.0" -} }
66
+ { {- if and (regexFind $versionRegex $imageVersion | semverCompare " >= 1.12.0" ) (regexFind $versionRegex $imageVersion | semverCompare " <= 1.12.17" ) -} }
69
67
22.12
70
- { {- else if regexFind $versionRegex $imageVersion | semverCompare " >= 1.11.0" -} }
68
+ { {- else if and ( regexFind $versionRegex $imageVersion | semverCompare " >= 1.11.0" ) (regexFind $ versionRegex $ imageVersion | semverCompare " <= 1.11.18 " ) -} }
71
69
22.03
72
70
{ {- else -} }
73
71
21.06
Original file line number Diff line number Diff line change @@ -138,14 +138,20 @@ function is_clustered {
138
138
139
139
function set_nb_version_compatibility() {
140
140
if [ -n " $OVN_VERSION_COMPATIBILITY " ]; then
141
- if ! ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS get NB_Global . options | grep -q version_compatibility=; then
142
- ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
141
+ alias _nbctl=" ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS "
142
+ if ! _nbctl get NB_Global . external-ids | grep -w ' ovn-match-northd-version="true"' ; then
143
+ # Do not set version_compatibility. Use ovn-controller external-ids:ovn-match-northd-version=true instead.
143
144
return
144
145
fi
145
- value=` ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
146
+
147
+ if ! _nbctl get NB_Global . options | grep -q version_compatibility=; then
148
+ _nbctl set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
149
+ return
150
+ fi
151
+ value=` _nbctl get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
146
152
echo " ovn nb global option version_compatibility is set to $value "
147
153
if [ " $value " != " _$OVN_VERSION_COMPATIBILITY " ]; then
148
- ovn-nbctl --db= $( gen_conn_str 6641 ) $SSL_OPTIONS set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
154
+ _nbctl set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
149
155
fi
150
156
fi
151
157
}
Original file line number Diff line number Diff line change @@ -34,10 +34,14 @@ function gen_conn_str {
34
34
echo " $x "
35
35
}
36
36
37
- nb_addr=" $( gen_conn_str 6641) "
37
+ alias _nbctl=" ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS "
38
+ if ! _nbctl get NB_Global . external-ids | grep -w ' ovn-match-northd-version="true"' ; then
39
+ exit
40
+ fi
41
+
38
42
while true ; do
39
- if [ x` ovn-nbctl --db= $nb_addr $SSL_OPTIONS get NB_Global . options | grep -o ' version_compatibility=' ` != " x" ]; then
40
- value=` ovn-nbctl --db= $nb_addr $SSL_OPTIONS get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
43
+ if [ x` _nbctl get NB_Global . options | grep -o ' version_compatibility=' ` != " x" ]; then
44
+ value=` _nbctl get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
41
45
echo " ovn NB_Global option version_compatibility is set to $value "
42
46
if [ " $value " = " $OVN_VERSION_COMPATIBILITY " -o " $value " = " _$OVN_VERSION_COMPATIBILITY " ]; then
43
47
break
78
82
kubectl -n $POD_NAMESPACE rollout status ds/ovs-ovn
79
83
fi
80
84
81
- ovn-nbctl --db=$nb_addr $SSL_OPTIONS set NB_Global . options:version_compatibility=_$OVN_VERSION_COMPATIBILITY
85
+ _nbctl set NB_Global . external-ids:ovn-match-northd-version=true
86
+ _nbctl remove NB_Global . options version_compatibility
You can’t perform that action at this time.
0 commit comments