File tree 3 files changed +22
-14
lines changed
charts/kube-ovn/templates
3 files changed +22
-14
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 @@ -139,15 +139,20 @@ function is_clustered {
139
139
140
140
function set_nb_version_compatibility() {
141
141
if [ -n " $OVN_VERSION_COMPATIBILITY " ]; then
142
- if ! ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS get NB_Global . options | grep -q version_compatibility= ; then
143
- echo " setting ovn NB_Global option version_compatibility to ${OVN_VERSION_COMPATIBILITY} "
144
- ovn-nbctl --db= $( gen_conn_str 6641 ) $SSL_OPTIONS set NB_Global . options:version_compatibility= ${OVN_VERSION_COMPATIBILITY}
142
+ alias _nbctl= " ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS "
143
+ if ! _nbctl get NB_Global . external-ids | grep -w ' ovn-match-northd-version="true" ' ; then
144
+ # Do not set version_compatibility. Use ovn-controller external-ids:ovn-match-northd-version=true instead.
145
145
return
146
146
fi
147
- value=` ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
147
+
148
+ if ! _nbctl get NB_Global . options | grep -q version_compatibility=; then
149
+ _nbctl set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
150
+ return
151
+ fi
152
+ value=` _nbctl get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
148
153
echo " ovn nb global option version_compatibility is set to $value "
149
154
if [ " $value " != " _$OVN_VERSION_COMPATIBILITY " ]; then
150
- ovn-nbctl --db= $( gen_conn_str 6641 ) $SSL_OPTIONS set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
155
+ _nbctl set NB_Global . options:version_compatibility=${OVN_VERSION_COMPATIBILITY}
151
156
fi
152
157
fi
153
158
}
Original file line number Diff line number Diff line change @@ -32,11 +32,15 @@ function gen_conn_str {
32
32
echo " $x "
33
33
}
34
34
35
- nb_addr=" $( gen_conn_str 6641) "
35
+ alias _nbctl=" ovn-nbctl --db=$( gen_conn_str 6641) $SSL_OPTIONS "
36
+ if ! _nbctl get NB_Global . external-ids | grep -w ' ovn-match-northd-version="true"' ; then
37
+ exit
38
+ fi
39
+
36
40
while true ; do
37
- if [ x` ovn-nbctl --db= $nb_addr $SSL_OPTIONS get NB_Global . options | grep -o ' version_compatibility=' ` != " x" ]; then
38
- value=` ovn-nbctl --db= $nb_addr $SSL_OPTIONS get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
39
- echo " ovn NB_Global option version_compatibility is already set to $value "
41
+ if [ x` _nbctl get NB_Global . options | grep -o ' version_compatibility=' ` != " x" ]; then
42
+ value=` _nbctl get NB_Global . options:version_compatibility | sed -e ' s/^"//' -e ' s/"$//' `
43
+ echo " ovn NB_Global option version_compatibility is set to $value "
40
44
if [ " $value " = " $OVN_VERSION_COMPATIBILITY " -o " $value " = " _$OVN_VERSION_COMPATIBILITY " ]; then
41
45
break
42
46
fi
76
80
kubectl -n $POD_NAMESPACE rollout status ds/ovs-ovn
77
81
fi
78
82
79
- ovn-nbctl --db=$nb_addr $SSL_OPTIONS set NB_Global . options:version_compatibility=_$OVN_VERSION_COMPATIBILITY
83
+ _nbctl set NB_Global . external-ids:ovn-match-northd-version=true
84
+ _nbctl remove NB_Global . options version_compatibility
You can’t perform that action at this time.
0 commit comments