X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=bin%2Fundeploy-nonrtric;h=6b7188781ac611dacae8d49ff0e43476f7ccafe7;hb=538db334410daa7980de36b5632aa90c8e863d8e;hp=162bf6e682878f0519cd0550d47aadb5ae2a5601;hpb=0c128bcaaf18f8b45b424ccdd1d631cc77d34559;p=it%2Fdep.git diff --git a/bin/undeploy-nonrtric b/bin/undeploy-nonrtric index 162bf6e6..6b718878 100755 --- a/bin/undeploy-nonrtric +++ b/bin/undeploy-nonrtric @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Copyright (c) 2020 Nordix Foundation. # +# Copyright (c) 2023 Nordix Foundation. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -17,7 +17,7 @@ # This script to undeploy the NONRTRIC -COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore" +COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore ranpm" 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 @@ -31,12 +31,23 @@ NAMESPACE_BLOCK=$(cat /tmp/recipe.yaml | awk '/^ namespace:/{getline; while ($0 NONRTRIC_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *nonrtric:/{print $2}') RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}') 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 fi +ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +if [ "$INSTALL_RANPM" = true ];then + echo "Running uninstall-ranpm.sh" + chmod +x ${ROOT_DIR}/../ranpm/install/uninstall-ranpm.sh + ${ROOT_DIR}/../ranpm/install/uninstall-ranpm.sh + kubectl delete ns ran + echo "uninstall-ranpm.sh completed" +fi + echo "Undeploying NONRTRIC components [$COMPONENTS]" IS_HELM3=$(helm version -c --short|grep -e "^v3") @@ -53,3 +64,5 @@ helm delete ${HELM_FLAG} ${RELEASE_PREFIX} kubectl delete cm -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe kubectl delete ns ${NONRTRIC_NAMESPACE:-nonrtric} + +kubectl delete ns onap