prole/tmp/poll_gitlab_ns.sh

23 lines
933 B
Bash

#!/usr/bin/env bash
export KUBECONFIG=/Users/chrisfu/dev/knoe/knoe-k3s.kubeconfig
for i in $(seq 1 30); do
pct=$(grep -oE '\[([0-9]+)%\]' /Users/chrisfu/dev/knoe/logs/install_final2.log 2>/dev/null | tail -1)
ns_gitlab=$(kubectl get ns gitlab --no-headers 2>/dev/null | awk '{print $1}')
echo "[$(date -u '+%H:%M')] [$i/30] installer=$pct | gitlab ns=${ns_gitlab:-none}"
if [[ -n "$ns_gitlab" ]]; then
echo "==> gitlab namespace exists! Checking pods..."
kubectl -n gitlab get pods --no-headers 2>/dev/null | grep -v jemalloc | head -8
echo "==> Checking for gitea ns (should be absent):"
kubectl get ns gitea --no-headers 2>/dev/null || echo " gitea: absent (correct)"
break
fi
# Also break if installer finished
if ! ps aux | grep -q "install.sh"; then
echo "==> Installer finished. Log tail:"
tail -5 /Users/chrisfu/dev/knoe/logs/install_final2.log | cat
break
fi
sleep 60
done