blob: 7c2a1e29f057a4dea6bc1395b3e635432df20370 [file] [log] [blame]
Gary Wu950a3232019-03-26 13:08:29 -07001#!/bin/bash
2
3IFS='
4'
5
6if [ -z $1 ]; then
7 echo "ONAP component name missing"
8 echo "Usage: ./cleanup.sh onap_component_name"
9 exit 1
10fi
11
12COMPONENT=$1
13
14if [ $COMPONENT == "dcae" ] || [ $COMPONENT == "DCAE" ]; then
15 kubectl delete service consul -n onap
16fi
17
18for op in secrets configmaps pvc pv services deployments statefulsets clusterrolebinding; do
19 ARRAY=(`kubectl get $op -n onap | grep dev-$COMPONENT | awk '{print $1}'`)
20 for i in ${ARRAY[*]}; do
21 kubectl delete $op -n onap $i
22 done
23done