-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_simple_fio.sh
45 lines (35 loc) · 1.24 KB
/
delete_simple_fio.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
namespace=simple-fio
platform=`grep "^platform" config.file | awk -F "=" '{print $2}'`
delete_setup () {
oc project ${namespace}
oc get cm | grep fio
if [ `echo $?` -eq 0 ]; then
for cm in $(oc get cm -oname | grep fio); do oc delete $cm; done
fi
oc get pods | grep fio-server
if [ `echo $?` -eq 0 ]; then
for pod in $(oc get pods -oname | grep fio-server); do oc delete $pod; done
fi
if [[ $(oc get pods | grep fio-client | awk '{print $1}') == "fio-client" ]];
then
oc delete pod fio-client
fi
if [[ $(oc get pods | grep fio-prefill | awk '{print $1}') == "fio-prefill" ]];
then
oc delete pod fio-prefill
fi
oc get pvc | grep fio-pv-claim
if [ `echo $?` -eq 0 ]; then
for pvc in $(oc get pvc -oname | grep fio-pv-claim); do oc delete $pvc; done
fi
}
if [ $platform == "bm" ]; then
delete_setup
elif [ $platform == "hcp" ]; then
for consumer in $(cat consumers.lst)
do
# oc config use $consumer
delete_setup
done
fi