#!/bin/bash

. $(dirname "$0")/setenv.bash

delete_namespace() {
  kubectl delete namespace $1
}

delete_service_account() {
    kubectl delete clusterrolebinding $1-$2-admin-binding
    printf "Service account $1-$2-admin-binding deleted.\n\n"
}

delete_registry_key() {
  kubectl --namespace $1-$2 delete secret ${1}-docker-registry-key
}

delete_app_helm() {
  helm delete $1-$2 --purge
}

wait_terminate() {
  printf "Waiting for namespaces termination...\n"
  while true; do
    declare -i _STATUS=0
    for i in ${HELM_APPS[@]}; do
      kubectl get pods --namespace $1 | grep -w " $i" > /dev/null 2>&1
      if [ "$?" -ne "0" ]; then
        _STATUS=1
        break
      fi
    done

    if [ "$SINGLE_COMPONENT" == "false" ]; then
      kubectl get namespaces $1 > /dev/null 2>&1
      _STATUS=$?
    fi
    if [ "$_STATUS" -ne "0" ]; then
      break
    fi
    sleep 2
  done
}

usage() {
  cat <<EOF
Usage: $0 [PARAMs]
-u                  : Display usage
-n [NAMESPACE]      : Kubernetes namespace (required)
-c                  : kubectl context (default: current context)
-y                  : Skip interactive confirmation (default: no)
-a [APP]            : Specify a specific ONAP component (default: all)
                      from the following choices:
                      sdc, aai ,mso, message-router, robot, vid, aaf, uui
                      sdnc, portal, policy, appc, multicloud, clamp, consul, vnfsdk
-N                  : Do not wait for deletion of namespace and its objects
EOF
}

#MAINs
NS=
INCL_SVC=false
APP=
WAIT_TERMINATE=true
SKIP_INTERACTIVE_CONFIRMATION=no
KUBECTL_CONTEXT=
SINGLE_COMPONENT=false
while getopts ":c:n:u:s:a:yN" PARAM; do
  case $PARAM in
    u)
      usage
      exit 1
      ;;
    n)
      NS=${OPTARG}
      ;;
    a)
      APP=${OPTARG}
      if [[ -z $APP ]]; then
        usage
        exit 1
      fi
      SINGLE_COMPONENT=true
      ;;
    N)
      WAIT_TERMINATE=false
      ;;
    y)
      SKIP_INTERACTIVE_CONFIRMATION=yes
      ;;
    c)
      KUBECTL_CONTEXT=${OPTARG}
      ;;
    ?)
      usage
      exit
      ;;
  esac
done

if [[ -z $NS ]]; then
  usage
  exit 1
fi

if [[ "$SKIP_INTERACTIVE_CONFIRMATION" != yes ]]; then
  current_kubectl_context=$(kubectl config get-contexts |grep "*" |awk '{print $2}')
  if test "$KUBECTL_CONTEXT" != "$current_kubectl_context"; then
    printf "Current kubectl context does not match context specified:\x1b[31m $current_kubectl_context\x1b[0m\n"
    if [ ! -z "$KUBECTL_CONTEXT" -a "$KUBECTL_CONTEXT" != " " ]; then
      read -p "Do you wish to switch context to $KUBECTL_CONTEXT and continue?" yn
      case $yn in
        [Yy]* ) kubectl config use-context $KUBECTL_CONTEXT;;
        * ) printf "Skipping delete...\n"; exit;;
      esac
    else
      printf "You are about to delete deployment from:\x1b[31m $current_kubectl_context\x1b[0m\n"
      read -p "To continue enter context name: " response

      if test "$response" != "$current_kubectl_context"
      then
        printf "Your response does not match current context! Skipping delete ...\n"
        exit 1
      fi
    fi
  fi
fi

if [[ ! -z "$APP" ]]; then
  HELM_APPS=($APP)
fi

printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n"

for i in ${HELM_APPS[@]}; do
  delete_app_helm $NS $i
  delete_service_account $NS $i
done

if [ "$SINGLE_COMPONENT" == "false" ]
then
    delete_app_helm $NS "config"
    delete_namespace $NS
fi

if $WAIT_TERMINATE; then
  wait_terminate $NS
fi

printf "\n********** Gone **********\n"
