diff --git a/CHANGELOG.md b/CHANGELOG.md index ed63e53645..0aac851c80 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 + +### Added + +- 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) ### 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: {}