Skip to content

Commit 24462bd

Browse files
pinheadmzwillcl-ark
authored andcommitted
scripts: catch / retry in connect_logging.sh
1 parent 048367a commit 24462bd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#!/bin/bash
2-
set -e
2+
# NO `set -e` here so an error does not exit the script
33

44
POD_NAME=$(kubectl get pods --namespace warnet-logging -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=loki-grafana" -o jsonpath="{.items[0].metadata.name}")
55

66
echo "Go to http://localhost:3000"
7+
echo "Grafana pod name: ${POD_NAME}"
78

8-
kubectl --namespace warnet-logging port-forward "${POD_NAME}" 3000
9+
while true; do
10+
echo "Attempting to start Grafana port forwarding"
11+
kubectl --namespace warnet-logging port-forward "${POD_NAME}" 3000 2>&1
12+
echo "Grafana port forwarding exited with status: $?"
13+
sleep 5
14+
done;
15+
16+
echo "warnet-logging port-forward exited"

0 commit comments

Comments
 (0)