File tree Expand file tree Collapse file tree 3 files changed +21
-12
lines changed
charts/kube-ovn/templates Expand file tree Collapse file tree 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
6363 { {- $imageVersion := (index $ds .spec.template.spec.containers 0).image | splitList " :" | last | trimPrefix " v" -} }
6464 { {- $versionRegex := `^(?P< major> 0|[1-9]\d*)\.(?P< minor> 0|[1-9]\d*)\.(?P< patch> 0|[1-9]\d*)` -} }
6565 { {- 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" ) -} }
6967 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 " ) -} }
7169 22.03
7270 { {- else -} }
7371 21.06
Original file line number Diff line number Diff line change @@ -138,14 +138,20 @@ function is_clustered {
138138
139139function set_nb_version_compatibility() {
140140 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.
143144 return
144145 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/"$//' `
146152 echo " ovn nb global option version_compatibility is set to $value "
147153 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}
149155 fi
150156 fi
151157}
Original file line number Diff line number Diff line change @@ -34,10 +34,14 @@ function gen_conn_str {
3434 echo " $x "
3535}
3636
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+
3842while 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/"$//' `
4145 echo " ovn NB_Global option version_compatibility is set to $value "
4246 if [ " $value " = " $OVN_VERSION_COMPATIBILITY " -o " $value " = " _$OVN_VERSION_COMPATIBILITY " ]; then
4347 break
7882 kubectl -n $POD_NAMESPACE rollout status ds/ovs-ovn
7983fi
8084
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