From: Dominik Fleischmann Date: Fri, 17 Jul 2020 09:15:29 +0000 (+0200) Subject: Add waiting period to Storage Class creation X-Git-Tag: v8.0.0rc3~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F9448%2F4;p=osm%2Fdevops.git Add waiting period to Storage Class creation This commit adds a waiting period until the storage class is available. It also fixes a minor bug in the juju add-k8s command. This fixes Bug 1155 Change-Id: Ie4d35847bd053c9e4e61f89a481faef5e348f5e2 Signed-off-by: Dominik Fleischmann --- diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index ec44acfd..1a800e4c 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -423,7 +423,7 @@ function juju_createcontroller() { } function juju_addk8s() { - cat .kube/config | juju add-k8s $OSM_VCA_K8S_CLOUDNAME --controller $OSM_STACK_NAME --storage openebs-hostpath + cat $HOME/.kube/config | juju add-k8s $OSM_VCA_K8S_CLOUDNAME --controller $OSM_STACK_NAME --storage openebs-hostpath } function juju_createproxy() { @@ -782,6 +782,21 @@ function kube_config_dir() { function install_k8s_storageclass() { kubectl apply -f https://openebs.github.io/charts/openebs-operator-1.6.0.yaml + local storageclass_timeout=300 + local counter=0 + echo "Waiting for storageclass" + while (( counter < storageclass_timeout )) + do + kubectl get storageclass openebs-hostpath &> /dev/null + + if [ $? -eq 0 ] ; then + echo "Storageclass available" + break + else + counter=$((counter + 15)) + sleep 15 + fi + done kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' }