prole/tmp/force_delete_ns.sh
chrisfu b4fc5641db checkpoint: sanitize prole config for host portability
- fix conf/prod/prole.cfg by replacing hardcoded /Users/chrisfu paths with /Users/chrisfu

- remove injected [update.sh] log lines and stray password artifacts so config is executable

- include latest pending updates across deployment config, UI/core flow, vault/network artifacts, and helper scripts
2026-04-10 05:58:40 -07:00

25 lines
890 B
Bash

#!/usr/bin/env bash
set -euo pipefail
export KUBECONFIG=/Users/chrisfu/dev/prole/prole-k3s.kubeconfig
echo "==> Resources blocking termination:"
kubectl -n gitlab get all --ignore-not-found 2>&1 | head -20 || true
echo "==> Force-removing finalizers from stuck GitLab CRs..."
for res in $(kubectl -n gitlab get gitlabs.apps.gitlab.com --no-headers -o name 2>/dev/null || true); do
kubectl -n gitlab patch "$res" -p '{"metadata":{"finalizers":[]}}' --type=merge 2>/dev/null || true
done
echo "==> Forcing namespace finalizer removal via API..."
kubectl get namespace gitlab -o json 2>/dev/null | \
python3 -c "
import sys, json
d = json.load(sys.stdin)
d['spec']['finalizers'] = []
print(json.dumps(d))
" | kubectl replace --raw /api/v1/namespaces/gitlab/finalize -f - 2>&1 || true
sleep 10
echo "==> Namespace status:"
kubectl get ns gitlab 2>&1 || echo "Namespace gone — clean."