reliability improvements
fix some of the templating make the uninstall script loop over all disableable apps and disable them
This commit is contained in:
parent
86b06f4196
commit
8e8325a86e
|
@ -1,4 +1,4 @@
|
|||
# {{ if (index .Values "haproxy-ingress").enabled -}}
|
||||
# {{ if (index .Values "haproxy-ingress").enabled }}
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
|
@ -14,7 +14,8 @@ spec:
|
|||
repoURL: https://haproxy-ingress.github.io/charts
|
||||
targetRevision: 0.14.2
|
||||
helm:
|
||||
values: |-{{ (index .Values "haproxy-ingress").values | nindent 8 }}
|
||||
values: |-
|
||||
{{ (index .Values "haproxy-ingress").values | nindent 8 }}
|
||||
releaseName: haproxy-ingress
|
||||
destination:
|
||||
server: "https://kubernetes.default.svc"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# {{ if (index .Values "sealed-secrets").enabled -}}
|
||||
# {{ if (index .Values "sealed-secrets").enabled }}
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ if (index .Values "secrets").enabled -}}
|
||||
# {{ if (index .Values "secrets").enabled }}
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
|
@ -30,4 +30,4 @@ spec:
|
|||
duration: 5s
|
||||
factor: 2
|
||||
maxDuration: 3m0s
|
||||
{{- end }}
|
||||
# {{- end }}
|
||||
|
|
20
uninstall.sh
20
uninstall.sh
|
@ -5,12 +5,28 @@ cd "$(dirname "$0")/argo1"
|
|||
TARGETNS="argocd"
|
||||
ORIGNS="$(kubectl config view --minify -o jsonpath='{..namespace}')"
|
||||
|
||||
all_subapps() {
|
||||
(
|
||||
for f in templates/*.yaml;do
|
||||
sed -e '1!d' "$f"
|
||||
done
|
||||
) \
|
||||
| grep -Eo '^#? *[{][{](- )? *if [(]index [.]Values "[^"]*"[)][.]enabled *( -)?[}][}]' \
|
||||
| cut -d '"' -f 2
|
||||
}
|
||||
|
||||
(
|
||||
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
|
||||
(
|
||||
IFS=$'\n'
|
||||
for app in $(all_subapps);do
|
||||
argocd --core app set argo1 --helm-set "$app".enabled=false
|
||||
done
|
||||
)
|
||||
sleep 10
|
||||
argocd --core app wait --sync argo1
|
||||
helm uninstall -n "$TARGETNS" argo1
|
||||
bash delete-crds.sh
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user