X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=nonrtric%2Fbin%2Funinstall;h=d0549f57e7236a31b45359b7b2a80ab6483546f9;hb=refs%2Fchanges%2F35%2F5935%2F6;hp=584a7b4bbdeab1c60396222c71ad6fc29a9e9927;hpb=16d1788c8835feb3bf819711704cb63a2116c829;p=it%2Fdep.git diff --git a/nonrtric/bin/uninstall b/nonrtric/bin/uninstall index 584a7b4b..d0549f57 100755 --- a/nonrtric/bin/uninstall +++ b/nonrtric/bin/uninstall @@ -16,7 +16,7 @@ ################################################################################ -COMPONENTS="controlpanel a1controller a1simulator policymanagementservice enrichmentservice" +COMPONENTS="controlpanel a1controller a1simulator policymanagementservice enrichmentservice rappcatalogueservice nonrtricgateway" 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 @@ -32,7 +32,16 @@ RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}') echo "Undeploying NONRTRIC components [$COMPONENTS]" -helm delete --purge ${RELEASE_PREFIX} +IS_HELM3=$(helm version -c --short|grep -e "^v3") +HELM_FLAG='' +if [ $IS_HELM3 ] +then + HELM_FLAG=' -n '${NONRTRIC_NAMESPACE:-nonrtric} +else + HELM_FLAG='--purge' +fi + +helm delete ${HELM_FLAG} ${RELEASE_PREFIX} kubectl delete cm -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe