From 88928ad6bc29ca8ecd71e02447cd21333f53b522 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Fri, 6 Oct 2023 12:57:27 +0200 Subject: [PATCH] refactor(helm): skip db migration, in conditions (#1501) 1. if there are no version change 2. if skipMigration variable is set 3. if forceMigration variable is not set Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay/templates/job.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/helmcharts/openreplay/templates/job.yaml b/scripts/helmcharts/openreplay/templates/job.yaml index 9cde03315..8c6ae78a1 100644 --- a/scripts/helmcharts/openreplay/templates/job.yaml +++ b/scripts/helmcharts/openreplay/templates/job.yaml @@ -1,4 +1,10 @@ -{{- if not .Values.skipMigration}} +{{/* +Don't have to trigger migration if there is no version change +Don't have to trigger migration if skipMigration is set +Have to trigger migration if forceMigration is set +*/}} +{{- $versionChange := and (eq .Values.fromVersion .Chart.AppVersion) (.Release.IsUpgrade) }} +{{- if or (not (or .Values.skipMigration $versionChange)) .Values.forceMigration }} --- apiVersion: v1 kind: ConfigMap