argocd/argo1/uninstall.sh

19 lines
571 B
Bash
Raw Normal View History

2023-04-24 01:34:24 +00:00
#!/bin/bash
cd "$(dirname "$0")"
TARGETNS="argocd"
ORIGNS="$(kubectl config view --minify -o jsonpath='{..namespace}')"
(
set -e
[ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace $TARGETNS
argocd --core app set argo1 --helm-set sealed-secrets.enabled=false --helm-set secrets.enabled=false
argocd --core app sync argo1 || argocd --core app wait --sync argo1
helm uninstall -n "$TARGETNS" argo1
bash delete-crds.sh
)
[ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace "$ORIGNS"