Unsuspend system helmreleases on cozystack restart (#219)

Developers ofthen forget to unsuspend helm releases after the local
development (I do!)
This change make ensure that all system helm charts are getting
reconciled by flux after cozystack container restart

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil
2024-07-18 19:55:24 +02:00
committed by GitHub
parent 9bbdb11aab
commit 7c77a6594a
2 changed files with 6 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ metadata:
namespace: {{ $x.namespace }}
labels:
cozystack.io/repository: system
cozystack.io/system-app: "true"
spec:
interval: 5m
releaseName: {{ $x.releaseName | default $x.name }}

View File

@@ -79,6 +79,11 @@ 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
done
# Reconcile platform chart
trap 'exit' INT TERM
while true; do