-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpreflight_check.sh
29 lines (26 loc) · 932 Bytes
/
preflight_check.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
#==========================================================
# Creating and setting up the namespace
# ---------------------------------------------------------
namespace="simple-fio"
if [ `oc get project | grep ${namespace} | awk '{print $1}'` ]
then
oc project ${namespace} > /dev/null
else
echo "Creating project simple-fio"
oc create namespace ${namespace}
oc project ${namespace}
fi
#============================
# Check fio storage pod is up
#----------------------------
if [[ $(oc get pvc | grep fio-data-pvc | awk '{print $1}') != "fio-data-pvc" ]];
then
sc_type=$(oc get sc | grep cephfs | awk '{print $1}')
export sc_type=${sc_type}
envsubst < fio-data-pvc.yaml | oc create -f -
#oc create -f fio-data-pvc.yaml
fi
if [[ $(oc get pods | grep fio-storage | awk '{print $1}') != "fio-storage" ]];
then
oc apply -f fio-storage.yaml
fi