Skip to content

Commit

Permalink
Unsuspend all cozystack charts on start
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
  • Loading branch information
kvaps committed Oct 16, 2024
1 parent 2e16f78 commit 901d9cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 901d9cd

Please sign in to comment.