From 31544abb510f615172dc19eaeb96e342b80de222 Mon Sep 17 00:00:00 2001 From: MengxinLiu Date: Sun, 18 Aug 2019 12:07:13 +0800 Subject: [PATCH] fix: deal with ipv6 connection str --- dist/images/start-controller.sh | 2 +- dist/images/start-db.sh | 8 ++++---- yamls/crd.yaml | 8 +++++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/images/start-controller.sh b/dist/images/start-controller.sh index 3f269ff69b0..6e034234a22 100755 --- a/dist/images/start-controller.sh +++ b/dist/images/start-controller.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -euo pipefail -export OVN_NB_DAEMON=$(ovn-nbctl --db=tcp:${OVN_NB_SERVICE_HOST}:${OVN_NB_SERVICE_PORT} --pidfile --detach) +export OVN_NB_DAEMON=$(ovn-nbctl --db=tcp:[${OVN_NB_SERVICE_HOST}]:${OVN_NB_SERVICE_PORT} --pidfile --detach) exec ./kube-ovn-controller --ovn-nb-host=${OVN_NB_SERVICE_HOST} --ovn-nb-port=${OVN_NB_SERVICE_PORT} $@ \ No newline at end of file diff --git a/dist/images/start-db.sh b/dist/images/start-db.sh index ad379228a0b..aa6a4fef16a 100755 --- a/dist/images/start-db.sh +++ b/dist/images/start-db.sh @@ -1,9 +1,9 @@ #!/bin/bash set -eo pipefail -DB_NB_ADDR=${DB_NB_ADDR:-0.0.0.0} +DB_NB_ADDR=${DB_NB_ADDR:-::} DB_NB_PORT=${DB_NB_PORT:-6641} -DB_SB_ADDR=${DB_SB_ADDR:-0.0.0.0} +DB_SB_ADDR=${DB_SB_ADDR:-::} DB_SB_PORT=${DB_SB_PORT:-6642} function gen_conn_str { @@ -60,7 +60,7 @@ else fi # ovn-nb and ovn-sb listen on tcp ports for ovn-controller to connect -ovn-nbctl set-connection ptcp:${DB_NB_PORT}:${DB_NB_ADDR} -ovn-sbctl set-connection ptcp:${DB_SB_PORT}:${DB_SB_ADDR} +ovn-nbctl set-connection ptcp:${DB_NB_PORT}:[${DB_NB_ADDR}] +ovn-sbctl set-connection ptcp:${DB_SB_PORT}:[${DB_SB_ADDR}] tail -f /var/log/openvswitch/ovn-northd.log \ No newline at end of file diff --git a/yamls/crd.yaml b/yamls/crd.yaml index 93cee178514..efee4f0711c 100644 --- a/yamls/crd.yaml +++ b/yamls/crd.yaml @@ -61,6 +61,12 @@ spec: - name: GatewayType type: string JSONPath: .spec.gatewayType + - name: Used + type: integer + JSONPath: .status.usingIPs + - name: Available + type: integer + JSONPath: .status.availableIPs validation: openAPIV3Schema: properties: @@ -70,4 +76,4 @@ spec: cidrBlock: type: "string" gateway: - type: "string" + type: "string" \ No newline at end of file