From 072c4d0a9262e80dcfcbff52195abfcb9329fe57 Mon Sep 17 00:00:00 2001 From: Matthias Teich Date: Wed, 22 Feb 2023 07:19:14 +0100 Subject: [PATCH 1/2] Add option to use helm hook for migration job --- CHANGELOG.md | 6 ++++++ helm/oncall/Chart.yaml | 4 ++-- helm/oncall/templates/engine/job-migrate.yaml | 6 ++++++ helm/oncall/values.yaml | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed63e53645..9b82f0a0b5 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). +## v1.2.12 (2023-04-14) + +### Added + +- Helm chart: add the option to use a helm hook for the migration job + ## v1.2.11 (2023-04-14) ### Added diff --git a/helm/oncall/Chart.yaml b/helm/oncall/Chart.yaml index 5d65a1261c..575d86830d 100644 --- a/helm/oncall/Chart.yaml +++ b/helm/oncall/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: oncall description: Developer-friendly incident response with brilliant Slack integration type: application -version: 1.2.8 -appVersion: v1.2.8 +version: 1.2.9 +appVersion: v1.2.9 dependencies: - name: cert-manager version: v1.8.0 diff --git a/helm/oncall/templates/engine/job-migrate.yaml b/helm/oncall/templates/engine/job-migrate.yaml index 2bb478fa91..b92d2939de 100644 --- a/helm/oncall/templates/engine/job-migrate.yaml +++ b/helm/oncall/templates/engine/job-migrate.yaml @@ -2,7 +2,13 @@ apiVersion: batch/v1 kind: Job metadata: + {{- if .Values.migrate.useHook }} + name: {{ printf "%s-migrate" (include "oncall.engine.fullname" .) }} + annotations: + "helm.sh/hook": post-install,post-upgrade + {{- else }} name: {{ printf "%s-migrate-%s" (include "oncall.engine.fullname" .) (now | date "2006-01-02-15-04-05") }} + {{- end }} labels: {{- include "oncall.engine.labels" . | nindent 4 }} spec: diff --git a/helm/oncall/values.yaml b/helm/oncall/values.yaml index 612e0c4946..5bfb08bb72 100644 --- a/helm/oncall/values.yaml +++ b/helm/oncall/values.yaml @@ -150,6 +150,8 @@ migrate: enabled: true # TTL can be unset by setting ttlSecondsAfterFinished: "" ttlSecondsAfterFinished: 20 + # use a helm hook to manage the migration job + useHook: false # Additional env variables to add to deployments env: {} From 48bcb4f07542d4826b4ab7c82fa64007d843e36a Mon Sep 17 00:00:00 2001 From: Ildar Iskhakov Date: Mon, 17 Apr 2023 18:16:52 +0800 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b82f0a0b5..0aac851c80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,11 @@ 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). -## v1.2.12 (2023-04-14) +## Unreleased ### Added -- Helm chart: add the option to use a helm hook for the migration job +- Helm chart: add the option to use a helm hook for the migration job ([1386](https://github.com/grafana/oncall/pull/1386)) ## v1.2.11 (2023-04-14)