argocd/argo1/uninstall.sh
2023-04-23 20:34:24 -05:00

19 lines
571 B
Bash

#!/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"