X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=bin%2Fundeploy-nonrtric;h=adfe28757e32d5bd24276070e6c3ef9d04597c79;hb=refs%2Fheads%2Fmaster;hp=d6c827a8ea8590b43495e743bc03daee40d87b8e;hpb=031a9115150163fbd148bc2b558cba8ae89fcd9a;p=it%2Fdep.git diff --git a/bin/undeploy-nonrtric b/bin/undeploy-nonrtric index d6c827a8..adfe2875 100755 --- a/bin/undeploy-nonrtric +++ b/bin/undeploy-nonrtric @@ -20,7 +20,26 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" echo "** $ROOT_DIR" -COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore ranpm" +COMPONENTS=" +a1controller \ +a1simulator \ +capifcore \ +controlpanel \ +dmaapadapterservice \ +dmaapmediatorservice \ +dmeparticipant \ +helmmanager \ +informationservice \ +nonrtricgateway \ +orufhrecovery \ +policymanagementservice \ +ransliceassurance \ +rappcatalogueenhancedservice \ +rappcatalogueservice \ +rappmanager \ +servicemanager \ +" + RECIPE_NAMESPACE=$(kubectl get cm --all-namespaces | grep nonrtric-recipe | awk '{print $1}') kubectl get configmap -n $RECIPE_NAMESPACE nonrtric-recipe -o jsonpath='{.data.recipe}' > /tmp/recipe.yaml @@ -37,8 +56,17 @@ INSTALL_KONG=$(cat /tmp/recipe.yaml | awk '/^ installKong:/{print $2}') INSTALL_RANPM=$(cat /tmp/recipe.yaml | awk '/^ installRanpm:/{print $2}') if [ "$INSTALL_KONG" = true ];then - echo "Uninstalling Kong" - helm delete kong-nonrtric --namespace kong + echo "Warning - deleting Kong routes and services for ServiceManager" + SERVICEMANAGER_POD=$(kubectl get pods -o custom-columns=NAME:.metadata.name -l app=nonrtric-servicemanager --no-headers -n ${NONRTRIC_NAMESPACE:-nonrtric}) + if [[ -n $SERVICEMANAGER_POD ]]; then + kubectl exec $SERVICEMANAGER_POD -n ${NONRTRIC_NAMESPACE:-nonrtric} -- ./kongclearup + else + echo "Error - Servicemanager pod not found, didn't delete Kong routes and services for ServiceManager" + fi + echo "Uninstalling kongstorage" + helm delete kongstorage -n "${NONRTRIC_NAMESPACE:-nonrtric}" + echo "Uninstalling Kong" + helm delete oran-nonrtric -n ${NONRTRIC_NAMESPACE:-nonrtric} fi ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"