From 1bd157f7f36069a8609959c477d873829943ddce Mon Sep 17 00:00:00 2001 From: Matthias Teich Date: Thu, 20 Apr 2023 07:39:53 +0200 Subject: [PATCH] Fix helm hook for migration job (#1789) # What this PR does This PR fixes the migration job when using helm hooks. ## Which issue(s) this PR fixes Currently when enabling the useHooks option in the helm chart there is a deadlock as the hook is defined as "post-upgrade, post-install". In this case the database migration will only be executed when all other pods are ready. This will not happen as the pods are waiting for the database migration. So we need to use "pre-install, preupgrade" instead of "post-install,post-upgrade" ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) Co-authored-by: Ildar Iskhakov --- CHANGELOG.md | 6 ++++++ helm/oncall/templates/engine/job-migrate.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7c5304..451e5432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Helm chart: Fix helm hook for db migration job + ## v1.2.14 (2023-04-19) ### Fixed diff --git a/helm/oncall/templates/engine/job-migrate.yaml b/helm/oncall/templates/engine/job-migrate.yaml index b92d2939..acf7fb2e 100644 --- a/helm/oncall/templates/engine/job-migrate.yaml +++ b/helm/oncall/templates/engine/job-migrate.yaml @@ -5,7 +5,7 @@ metadata: {{- if .Values.migrate.useHook }} name: {{ printf "%s-migrate" (include "oncall.engine.fullname" .) }} annotations: - "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook": pre-install,pre-upgrade {{- else }} name: {{ printf "%s-migrate-%s" (include "oncall.engine.fullname" .) (now | date "2006-01-02-15-04-05") }} {{- end }}