diff --git a/dist/images/start-ic-db.sh b/dist/images/start-ic-db.sh index 031a6e83e97..2c9b4d937a0 100755 --- a/dist/images/start-ic-db.sh +++ b/dist/images/start-ic-db.sh @@ -215,7 +215,18 @@ if [[ $ENABLE_OVN_LEADER_CHECK == "true" ]]; then chmod 600 /etc/ovn/* /kube-ovn/kube-ovn-leader-checker --probeInterval=${OVN_LEADER_PROBE_INTERVAL} --isICDBServer=true else - + # Compatible with controller deployment methods before kube-ovn 1.11.16 + TS_NAME=${TS_NAME:-ts} + PROTOCOL=${PROTOCOL:-ipv4} + if [ "$PROTOCOL" = "ipv4" ]; then + TS_CIDR=${TS_CIDR:-169.254.100.0/24} + elif [ "$PROTOCOL" = "ipv6" ]; then + TS_CIDR=${TS_CIDR:-fe80:a9fe:64::/112} + elif [ "$PROTOCOL" = "dual" ]; then + TS_CIDR=${TS_CIDR:-"169.254.100.0/24,fe80:a9fe:64::/112"} + fi + ovn-ic-nbctl --may-exist ts-add "$TS_NAME" + ovn-ic-nbctl set Transit_Switch ts external_ids:subnet="$TS_CIDR" tail --follow=name --retry /var/log/ovn/ovsdb-server-ic-nb.log fi