Skip to content

Commit 9a6e8e3

Browse files
ovnkube.sh: use node name as zone as default if ovn-ic
If the `k8s.ovn.org/zone-name` label is not set on the node, the fallback logic now uses the node name as the zone when `ovn_enable_interconnect` is true. Otherwise, the zone defaults to "global" as before. Also updated the empty string check to use `-z`, which is more idiomatic in Bash. Signed-off-by: Flavio Fernandes <[email protected]>
1 parent 5115ef4 commit 9a6e8e3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dist/images/ovnkube.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,12 @@ function memory_trim_on_compaction_supported {
813813
function get_node_zone() {
814814
zone=$(kubectl --subresource=status --server=${K8S_APISERVER} --token=${k8s_token} --certificate-authority=${K8S_CACERT} \
815815
get node ${K8S_NODE} -o=jsonpath={'.metadata.labels.k8s\.ovn\.org/zone-name'})
816-
if [ "$zone" == "" ]; then
817-
zone="global"
816+
if [ -z "$zone" ]; then
817+
if [[ ${ovn_enable_interconnect} == "true" ]]; then
818+
zone="${K8S_NODE}"
819+
else
820+
zone="global"
821+
fi
818822
fi
819823
echo "$zone"
820824
}

0 commit comments

Comments
 (0)