refactor(helm): skip db migration, in conditions

1. if there are no version change
2. if skipMigration variable is set
3. if forceMigration variable is not set

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
rjshrjndrn 2023-10-06 12:52:39 +02:00
parent dc5e023fa2
commit 9f0917ce5b
2 changed files with 14 additions and 1 deletions

7
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,7 @@
repos:
- repo: https://github.com/gitguardian/ggshield
rev: v1.14.5
hooks:
- id: ggshield
language_version: python3
stages: [commit]

View file

@ -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 := eq .Values.fromVersion .Chart.AppVersion}}
{{- if or (not (or .Values.skipMigration $versionChange)) .Values.forceMigration }}
---
apiVersion: v1
kind: ConfigMap