From 901d9cdfa835ca3e7a764e50eee858b98209fa23 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Wed, 16 Oct 2024 18:28:34 +0200 Subject: [PATCH] Unsuspend all cozystack charts on start Signed-off-by: Andrei Kvapil --- scripts/installer.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/installer.sh b/scripts/installer.sh index bfdb099fc..69226a647 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -79,9 +79,13 @@ fi # Reconcile Helm repositories kubectl annotate helmrepositories.source.toolkit.fluxcd.io -A -l cozystack.io/repository reconcile.fluxcd.io/requestedAt=$(date +"%Y-%m-%dT%H:%M:%SZ") --overwrite -# Unsuspend all system charts -kubectl get hr -A -l cozystack.io/system-app=true --no-headers | while read namespace name rest; do - kubectl patch hr -n "$namespace" "$name" -p '{"spec": {"suspend": null}}' --type=merge --field-manager=flux-client-side-apply +# Unsuspend all Cozystack managed charts +kubectl get hr -A -o go-template='{{ range .items }}{{ if .spec.suspend }}{{ .spec.chart.spec.sourceRef.namespace }}/{{ .spec.chart.spec.sourceRef.name }} {{ .metadata.namespace }} {{ .metadata.name }}{{ "\n" }}{{ end }}{{ end }}' | while read repo namespace name; do + case "$repo" in + cozy-system/cozystack-system|cozy-public/cozystack-extra|cozy-public/cozystack-apps) + kubectl patch hr -n "$namespace" "$name" -p '{"spec": {"suspend": null}}' --type=merge --field-manager=flux-client-side-apply + ;; + esac done # Reconcile platform chart