X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-aux%2Fbin%2Funinstall;h=5c1834e3460b4afb2b259e91d7db1909edaf607e;hb=c288ca9ecc3b7d468fb1d7d5f68ec3a9d3a02401;hp=50e6d430beba0dcae37b08275c6ce1e4a68d751b;hpb=dc00cdf008775e2ac5dddb186d1eb81e80370b69;p=it%2Fdep.git diff --git a/ric-aux/bin/uninstall b/ric-aux/bin/uninstall index 50e6d430..5c1834e3 100755 --- a/ric-aux/bin/uninstall +++ b/ric-aux/bin/uninstall @@ -34,13 +34,21 @@ RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}') echo "Undeploying AUX components [$COMPONENTS]" +IS_HELM3=$(helm version -c --short|grep -e "^v3") +HELM_FLAG='' +if [ $IS_HELM3 ] +then + HELM_FLAG=' -n '${AUXNAMESPACE:-ricaux} +else + HELM_FLAG='--purge' +fi for component in $COMPONENTS; do - helm delete --purge ${RELEASE_PREFIX}-$component + helm delete ${HELM_FLAG} ${RELEASE_PREFIX}-$component done kubectl delete cm -n ${AUXNAMESPACE:-ricaux} ricaux-recipe kubectl delete ns ${INFRANAMESPACE:-ricinfra} kubectl delete ns ${AUXNAMESPACE:-ricaux} -kubectl delete ns onap +#kubectl delete ns onap