3 . $(dirname "$0")/setenv.bash
7 kubectl delete namespace $_NS
10 delete_service_account() {
11 kubectl delete clusterrolebinding $1-$2-admin-binding
12 printf "Service account $1-$2-admin-binding deleted.\n\n"
15 delete_registry_key() {
16 kubectl --namespace $1-$2 delete secret ${1}-docker-registry-key
20 helm delete $1-$2 --purge
24 printf "Waiting for namespaces termination...\n"
27 for i in ${HELM_APPS[@]}; do
28 kubectl get namespaces $1-$i > /dev/null 2>&1
29 if [ "$?" -eq "0" ]; then
34 if [ "$_STATUS" -eq "0" ]; then
45 -n [NAMESPACE] : Kubernetes namespace (required)
46 -a [APP] : Specify a specific ONAP component (default: all)
47 from the following choices:
48 sdc, aai ,mso, message-router, robot, vid, aaf
49 sdnc, portal, policy, appc, multicloud, clamp, consul, vnfsdk
50 -N : Do not wait for deletion of namespace and its objects
60 while getopts ":n:u:s:a:N" PARAM; do
71 if [[ -z $APP ]]; then
91 if [[ ! -z "$APP" ]]; then
95 printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n"
98 for i in ${HELM_APPS[@]}; do
100 delete_app_helm $NS $i
101 delete_namespace $NS $i
102 delete_service_account $NS $i
106 if $WAIT_TERMINATE; then
110 printf "\n********** Gone **********\n"