From: David Garcia Date: Thu, 28 May 2020 16:03:25 +0000 (+0200) Subject: Fix usage of external kubernetes in charmed installer X-Git-Tag: v7.1.0rc5^0 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fdevops.git;a=commitdiff_plain;h=24e99f9116994ee15457cc67092e21da9b384804 Fix usage of external kubernetes in charmed installer When checking if the osm charms are deployed correctly, it only takes into account the case in which osm is installed in microk8s. Change-Id: Id534a40f36a71e6bcd43fb36d0811d69e151d2de Signed-off-by: David Garcia --- diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 78a1e127..c919086a 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -16,6 +16,7 @@ # set -eux K8S_CLOUD_NAME="k8s-cloud" +KUBECTL="microk8s.kubectl" IMAGES_OVERLAY_FILE=~/.osm/images-overlay.yaml function check_arguments(){ while [ $# -gt 0 ] ; do @@ -36,6 +37,7 @@ function check_arguments(){ function install_snaps(){ sudo snap install juju --classic [ ! -v KUBECFG ] && sudo snap install microk8s --classic && sudo usermod -a -G microk8s ubuntu && mkdir -p ~/.kube && sudo chown -f -R `whoami` ~/.kube + [ -v KUBECFG ] && sudo snap install kubectl --classic && KUBECTL="kubectl --kubeconfig $KUBECFG" } function bootstrap_k8s_lxd(){ @@ -139,9 +141,9 @@ function deploy_charmed_osm(){ function check_osm_deployed() { while true do - pod_name=`sg microk8s -c "microk8s.kubectl -n osm get pods | grep ui-k8s | grep -v operator" | awk '{print $1}'` - if [[ `sg microk8s -c "microk8s.kubectl -n osm wait pod $pod_name --for condition=Ready"` ]]; then - if [[ `sg microk8s -c "microk8s.kubectl -n osm wait pod lcm-k8s-0 --for condition=Ready"` ]]; then + pod_name=`sg microk8s -c "$KUBECTL -n osm get pods | grep ui-k8s | grep -v operator" | awk '{print $1}'` + if [[ `sg microk8s -c "$KUBECTL -n osm wait pod $pod_name --for condition=Ready"` ]]; then + if [[ `sg microk8s -c "$KUBECTL -n osm wait pod lcm-k8s-0 --for condition=Ready"` ]]; then break fi fi