Fix bug 1124: K8s added to juju after k8s has been initialized 31/9331/3
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 6 Jul 2020 15:03:39 +0000 (15:03 +0000)
committerbeierlm <mark.beierl@canonical.com>
Tue, 7 Jul 2020 13:42:05 +0000 (15:42 +0200)
Change-Id: I757eb90f35db1af95081c3e3dd3ffef30ff98197
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/full_install_osm.sh

index f19b481..22cb9f9 100755 (executable)
@@ -425,13 +425,13 @@ function juju_createcontroller() {
         sg lxd -c "juju bootstrap --bootstrap-series=xenial $OSM_VCA_CLOUDNAME $OSM_STACK_NAME"
     fi
     [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed"
-
-    if [ -n "$KUBERNETES" ]; then
-        cat .kube/config | juju add-k8s $OSM_VCA_K8S_CLOUDNAME --controller $OSM_STACK_NAME
-    fi
     juju controller-config features=[k8s-operators]
 }
 
+function juju_addk8s() {
+    cat .kube/config | juju add-k8s $OSM_VCA_K8S_CLOUDNAME --controller $OSM_STACK_NAME
+}
+
 function juju_createproxy() {
     check_install_iptables_persistent
 
@@ -1162,6 +1162,11 @@ EOF
         track docker_swarm
     fi
 
+    if [ -n "$KUBERNETES" ]; then
+        juju_addk8s
+        track juju_addk8s
+    fi
+
     [ -z "$DOCKER_NOBUILD" ] && generate_docker_images
     track docker_build