Creating auto killer of the job
Sometimes the operator don't start for some reason.
This will kill the job quicker and enable us to re-run the job easier if
it failes for random reasons.
@@ -31,6 +31,14 @@ kubectl -n $NS get khc
echo "get khs \n"
kubectl -n $NS get khs
+# If the operator dosen't start for some reason kill the test
+kubectl -n $NS get pods |grep NAME
+if [ $? != 0 ]
+then
+ echo "No operator pod found"
+ exit 1
+fi
+
# Wait for kuberhealthy operator to start
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n $NS get pods -l app=kuberhealthy -o jsonpath="$JSONPATH" 2>&1 |grep -q "Ready=True"; do sleep 1;echo "waiting for kuberhealthy operator to be available"; kubectl get pods -n $NS; done
