blob: 7c2a1e29f057a4dea6bc1395b3e635432df20370 [file] [log] [blame]
Marco Plataniaf3348ff2018-10-04 17:59:57 -04001#!/bin/bash
2
3IFS='
4'
5
6if [ -z $1 ]; then
Marco Platania2ed50a72018-10-11 22:48:58 -04007 echo "ONAP component name missing"
8 echo "Usage: ./cleanup.sh onap_component_name"
9 exit 1
Marco Plataniaf3348ff2018-10-04 17:59:57 -040010fi
11
12COMPONENT=$1
13
14if [ $COMPONENT == "dcae" ] || [ $COMPONENT == "DCAE" ]; then
Marco Platania2ed50a72018-10-11 22:48:58 -040015 kubectl delete service consul -n onap
Marco Plataniaf3348ff2018-10-04 17:59:57 -040016fi
17
Gary Wu65af29f2018-10-30 09:31:05 -070018for op in secrets configmaps pvc pv services deployments statefulsets clusterrolebinding; do
Marco Platania2ed50a72018-10-11 22:48:58 -040019 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
Marco Plataniaf3348ff2018-10-04 17:59:57 -040023done