Skip to content
Snippets Groups Projects

Simplify deletion of Workload Generator's ZooKeeper state

Merged Sören Henning requested to merge simplify-zookeeper-deletion into master
4 files
+ 12
72
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 3
18
@@ -90,25 +90,10 @@ echo "Finish topic deletion, print topics:"
echo "Delete ZooKeeper configurations used for workload generation"
kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 deleteall /workload-generation"
echo "Waiting for deletion"
while [ true ]
while kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 get /workload-generation"
do
IFS=', ' read -r -a array <<< $(kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 ls /" | tail -n 1 | awk -F[\]\[] '{print $2}')
found=0
for element in "${array[@]}"
do
if [ "$element" == "workload-generation" ]; then
found=1
break
fi
done
if [ $found -ne 1 ]; then
echo "ZooKeeper reset was successful."
break
else
echo "ZooKeeper reset was not successful. Retrying in 5s."
sleep 5s
fi
echo "Wait for ZooKeeper state deletion."
sleep 5s
done
echo "Deletion finished"
Loading