Skip to content

Commit

Permalink
chore(schema-migrator): update helm hooks annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Prashant Shahi <[email protected]>
  • Loading branch information
prashant-shahi committed Oct 28, 2024
1 parent 89399d9 commit 7bca088
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 0 additions & 4 deletions charts/signoz/templates/schema-migrator-async/migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ metadata:
name: {{ include "schemaMigrator.fullname" . }}-async{{ $schemaMigratorSuffix }}
labels:
{{- include "schemaMigrator.selectorLabels" . | nindent 4 }}
{{- if or .Release.IsUpgrade .Values.schemaMigrator.annotations }}
annotations:
{{- with .Values.schemaMigrator.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and .Release.IsUpgrade .Values.schemaMigrator.upgradeHelmHooks }}
helm.sh/hook: pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
{{- end }}
{{- end }}
spec:
template:
metadata:
Expand Down
4 changes: 2 additions & 2 deletions charts/signoz/templates/schema-migrator/migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ metadata:
{{- if and .Release.IsUpgrade .Values.schemaMigrator.upgradeHelmHooks }}
helm.sh/hook: pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
helm.sh/hook-weight: "-1"
argocd.argoproj.io/sync-wave: "-1"
{{- end }}
spec:
template:
Expand Down
10 changes: 8 additions & 2 deletions charts/signoz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,14 @@ schemaMigrator:

args:
- "--up="
annotations: {}
upgradeHelmHooks: true # set to false to disable helm hooks
# For usual Helm installs, we don't need any additional annotations.
# As well as for Helm upgrade (with upgradeHelmHooks to true), we automatically include the required pre-upgrade helm hooks.
# For ArgoCD, since every upgrade is an install, we need to explicitly specify the ArgoCD equivalent of the helm hooks.
annotations:
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
# This is needed for ArgoCD to sync the migrations.
upgradeHelmHooks: true

# -- Whether to enable replication for schemaMigrator
enableReplication: false
Expand Down

0 comments on commit 7bca088

Please sign in to comment.