Skip to content

Commit

Permalink
fix: dependencies sync waves
Browse files Browse the repository at this point in the history
  • Loading branch information
chliddle committed Dec 16, 2024
1 parent d5e1965 commit e28b382
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Binary file not shown.
Binary file removed charts/namada-indexer/charts/redis-20.5.0.tgz
Binary file not shown.
14 changes: 9 additions & 5 deletions charts/namada-indexer/templates/dependencies-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
annotations:
{{- if .Values.argocd.deployment }}
"argocd.argoproj.io/hook": "Sync"
"argocd.argoproj.io/sync-wave": "1"
"argocd.argoproj.io/sync-wave": "-1"
{{- else }}
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "-5"
Expand All @@ -29,8 +29,10 @@ spec:
- /bin/sh
- -c
- |
# Scale deployment to 0
kubectl scale deployment -n {{ .Release.Namespace }} {{ include "namada-indexer.fullname" . }} --replicas=0
# Only try to scale if deployment exists
if kubectl get deployment -n {{ .Release.Namespace }} {{ include "namada-indexer.fullname" . }}; then
kubectl scale deployment -n {{ .Release.Namespace }} {{ include "namada-indexer.fullname" . }} --replicas=0
fi
{{- if and .Values.postgresOperator.install.enabled .Values.postgresOperator.enabled }}
# Wait for PostgreSQL Operator to be ready
Expand Down Expand Up @@ -77,8 +79,10 @@ spec:
echo "All dependencies are ready!"
# Scale deployment back to desired replicas
kubectl scale deployment -n {{ .Release.Namespace }} {{ include "namada-indexer.fullname" . }} --replicas={{ .Values.replicaCount }}
# Only try to scale back if deployment exists
if kubectl get deployment -n {{ .Release.Namespace }} {{ include "namada-indexer.fullname" . }}; then
kubectl scale deployment -n {{ .Release.Namespace }} {{ include "namada-indexer.fullname" . }} --replicas={{ .Values.replicaCount }}
fi
echo "✅ Dependencies check completed, deployment scaled up to {{ .Values.replicaCount }} replicas"
exit 0
Expand Down

0 comments on commit e28b382

Please sign in to comment.