Skip to content

Commit 56dd166

Browse files
author
Jeff McCormick
committed
fix run.sh script to check for data directory
1 parent b4e4613 commit 56dd166

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

examples/operator/run.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1818

1919
$DIR/cleanup.sh
2020

21-
sudo mkdir /data
22-
sudo chmod 777 /data
21+
if [ -d /data ]; then
22+
echo "create the HostPath directory"
23+
sudo mkdir /data
24+
sudo chmod 777 /data
25+
echo "create the test PV and PVC using the HostPath dir"
26+
kubectl create -f $DIR/crunchy-pv.json
27+
sleep 3
28+
kubectl create -f $DIR/crunchy-pvc.json
29+
sleep 3
30+
fi
2331

2432
# copy all the operator templates to the PVC location
2533
sudo cp -r $COROOT/conf/postgres-operator /data
2634

27-
kubectl create -f $DIR/crunchy-pv.json
28-
29-
sleep 3
30-
kubectl create -f $DIR/crunchy-pvc.json
31-
32-
sleep 3
3335
kubectl create -f $DIR/deployment.json

0 commit comments

Comments
 (0)