Provide ovn-central-address for local deployments 42/91842/3
authorKonrad Bańka <k.banka@samsung.com>
Tue, 23 Jul 2019 06:32:54 +0000 (08:32 +0200)
committerKonrad Bańka <k.banka@samsung.com>
Tue, 23 Jul 2019 08:09:20 +0000 (10:09 +0200)
K8splugin served with docker-compose doesn't utilize
ovn-central-address configured in host environment.
Function responsible for generating config file has been
modified to provide this information if available.

Issue-ID: MULTICLOUD-708

Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Ie3c27c68c02a0e206f6447e8c4330e18af942cd8

deployments/_functions.sh

index 7942aed..45f2d8c 100755 (executable)
@@ -21,11 +21,16 @@ function start_mongo {
 }
 
 function generate_k8sconfig {
+    local ovn_address
+    if [ -n "${OVN_CENTRAL_ADDRESS:-}" ]; then
+        ovn_address="\"ovn-central-address\": \"${OVN_CENTRAL_ADDRESS}\","
+    fi
 cat << EOF > k8sconfig.json
 {
-    "database-address":     "${DATABASE_IP}",
+    "database-address": "${DATABASE_IP}",
     "database-type": "mongo",
     "plugin-dir": "plugins",
+    ${ovn_address}
     "service-port": "9015"
 }
 EOF