Marco Platania | f3348ff | 2018-10-04 17:59:57 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | IFS=' |
| 4 | ' |
| 5 | |
| 6 | if [ -z $1 ]; then |
Marco Platania | 2ed50a7 | 2018-10-11 22:48:58 -0400 | [diff] [blame] | 7 | echo "ONAP component name missing" |
| 8 | echo "Usage: ./cleanup.sh onap_component_name" |
| 9 | exit 1 |
Marco Platania | f3348ff | 2018-10-04 17:59:57 -0400 | [diff] [blame] | 10 | fi |
| 11 | |
| 12 | COMPONENT=$1 |
| 13 | |
| 14 | if [ $COMPONENT == "dcae" ] || [ $COMPONENT == "DCAE" ]; then |
Marco Platania | 2ed50a7 | 2018-10-11 22:48:58 -0400 | [diff] [blame] | 15 | kubectl delete service consul -n onap |
Marco Platania | f3348ff | 2018-10-04 17:59:57 -0400 | [diff] [blame] | 16 | fi |
| 17 | |
Gary Wu | 65af29f | 2018-10-30 09:31:05 -0700 | [diff] [blame] | 18 | for op in secrets configmaps pvc pv services deployments statefulsets clusterrolebinding; do |
Marco Platania | 2ed50a7 | 2018-10-11 22:48:58 -0400 | [diff] [blame] | 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 |
Marco Platania | f3348ff | 2018-10-04 17:59:57 -0400 | [diff] [blame] | 23 | done |