X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-infra%2F45-Tiller%2Fbin%2Funinstall;h=8045ef853ae3e5f4c0630255d2f4bc1de87a43f4;hb=2df61c2fcf64b32ecf7f064ef9cbbe6b54a15bc0;hp=64a01ab6fdb8cff27ccbeb4836b84076e75326cf;hpb=e8aa4b7ae26bc9454ea735df6174e28bcff0610a;p=it%2Fdep.git diff --git a/ric-infra/45-Tiller/bin/uninstall b/ric-infra/45-Tiller/bin/uninstall index 64a01ab6..8045ef85 100755 --- a/ric-infra/45-Tiller/bin/uninstall +++ b/ric-infra/45-Tiller/bin/uninstall @@ -17,39 +17,21 @@ ################################################################################ +COMPONENTS="xapp-tiller" + +echo "Undeploying RIC infra components [$COMPONENTS]" +for component in $COMPONENTS; do + RELEASE_LIST=$(helm list | grep "$component" | awk '{print $1}') + if [ ! -z "$RELEASE_LIST" ];then + NAMESPACE=$(helm list | grep "$component" | awk 'END{print $11}') + helm delete --purge $RELEASE_LIST + + SECRET_LIST=$(kubectl get secret -n $NAMESPACE | awk '{ if ($2=="Opaque"){ print $1}}') + + for component in $SECRET_LIST; do + kubectl delete secret -n $NAMESPACE $component + done + fi - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - - -source $DIR/../etc/tiller.conf - -if [ -z "$RICINFRA_RELEASE_NAME" ];then - RELEASE_NAME=$helm_release_name -else - RELEASE_NAME=$RICINFRA_RELEASE_NAME -fi - -if [ -z "$RICINFRA_NAMESPACE" ];then - INFRA_NAMESPACE=$infra_namespace -else - INFRA_NAMESPACE=$RICINFRA_NAMESPACE -fi - -RICINFRA_COMPONENTS="ricplt-tiller" - -echo "Undeploying RIC infra components [$RICINFRA_COMPONENTS]" -echo "Helm Release Name: $RELEASE_NAME" - - -for component in $RICINFRA_COMPONENTS; do - helm delete --purge "${RELEASE_NAME}-${component}" done - -# We need to manually delete the secret creates by the secret container -SECRET_LIST=$(kubectl get secret -n ricinfra | awk '{ if ($2=="Opaque"){ print $1}}') - -for component in $SECRET_LIST; do - kubectl delete secret -n $INFRA_NAMESPACE $component -done