fix run.sh to check for pvc creation apart from /data existence
@@ -22,15 +22,21 @@ if [ -z "$NAMESPACE" ]; then
export NAMESPACE=default
fi
+kubectl --namespace=$NAMESPACE get pvc crunchy-pvc
+rc=$?
+
+if [ ! $rc -eq 0 ]; then
+ echo "crunchy-pvc does not exist...creating crunchy-pvc "
+ kubectl --namespace=$NAMESPACE create -f $DIR/crunchy-pvc.json
+ $DIR/create-pv.sh
+else
+ echo "crunchy-pvc already exists..."
+fi
+
if [ ! -d /data ]; then
echo "create the HostPath directory"
sudo mkdir /data
sudo chmod 777 /data
- echo "create the test PV and PVC using the HostPath dir"
- $DIR/create-pv.sh
- sleep 3
- kubectl --namespace=$NAMESPACE create -f $DIR/crunchy-pvc.json
- sleep 3
fi
kubectl create configmap operator-conf \
@@ -42,4 +48,5 @@ envsubst < $DIR/deployment.json | kubectl --namespace=$NAMESPACE create -f -
sleep 3
kubectl get pod --selector=name=postgres-operator
+sleep 3
kubectl logs --selector=name=postgres-operator
