argo1/uninstall.sh
2023-04-23 21:56:38 -05:00

19 lines
577 B
Bash

#!/bin/bash
cd "$(dirname "$0")/argo1"
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"