From 7bca088550b73502c4b6e57692bf3db0249a29b5 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Mon, 28 Oct 2024 10:42:37 +0530 Subject: [PATCH] chore(schema-migrator): update helm hooks annotations Signed-off-by: Prashant Shahi --- .../templates/schema-migrator-async/migrations.yaml | 4 ---- .../signoz/templates/schema-migrator/migrations.yaml | 4 ++-- charts/signoz/values.yaml | 10 ++++++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/charts/signoz/templates/schema-migrator-async/migrations.yaml b/charts/signoz/templates/schema-migrator-async/migrations.yaml index b4c73f0..5b08123 100644 --- a/charts/signoz/templates/schema-migrator-async/migrations.yaml +++ b/charts/signoz/templates/schema-migrator-async/migrations.yaml @@ -9,7 +9,6 @@ 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 }} @@ -17,10 +16,7 @@ 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 {{- end }} - {{- end }} spec: template: metadata: diff --git a/charts/signoz/templates/schema-migrator/migrations.yaml b/charts/signoz/templates/schema-migrator/migrations.yaml index 3ec9a5b..7b47d8e 100644 --- a/charts/signoz/templates/schema-migrator/migrations.yaml +++ b/charts/signoz/templates/schema-migrator/migrations.yaml @@ -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: diff --git a/charts/signoz/values.yaml b/charts/signoz/values.yaml index f64028d..53e41f7 100644 --- a/charts/signoz/values.yaml +++ b/charts/signoz/values.yaml @@ -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