You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while [ "$(kubectl -n "$NS" get pod cgdrive -o jsonpath='{.status.phase}')"="Running" ] || \
81
-
[ "$(kubectl -n "$NS" get pod cgdrive -o jsonpath='{.status.phase}')"="Pending" ];do sleep 5;done
86
+
# Wait for the driver pod to finish. Break explicitly on terminal failure so a
87
+
# crashed/unschedulable pod gives a readable error instead of piping non-JSON
88
+
# logs into json.loads below.
89
+
while:;do
90
+
phase=$(kubectl -n "$NS" get pod cgdrive -o jsonpath='{.status.phase}'2>/dev/null ||echo Unknown)
91
+
case"$phase"in
92
+
Succeeded) break ;;
93
+
Running|Pending) sleep 5 ;;
94
+
*) echo"!! cgdrive pod ended in phase=$phase — the audit did not complete:"
95
+
kubectl -n "$NS" describe pod cgdrive | tail -n 25
96
+
kubectl -n "$NS" logs cgdrive 2>/dev/null ||true
97
+
exit 1 ;;
98
+
esac
99
+
done
82
100
echo"--- agent answer ($mode) ---"
83
101
kubectl -n "$NS" logs cgdrive | python3 -c 'import sys,json;b=sys.stdin.read().split("EXIT=")[0].strip();d=json.loads(b);r=d.get("result",{});m=(r.get("status")or{}).get("message")or{};p=m.get("parts") or (r.get("artifacts") or [{}])[0].get("parts",[]);print(" ".join(x.get("text","") for x in p)[:600])'
0 commit comments