Skip to content

Commit 0c42c2a

Browse files
Mattes83iskhakov
andauthoredApr 17, 2023
Add option to use helm hook for migration job (#1386)
# What this PR does This PR adds the option to use helm hooks for the database migration. ## Which issue(s) this PR fixes Currently oncall always shows as out-of-sync in argo-cd because the name changes on each hard refresh. When using a helm hook the job is executed on sync but does not show as out-of-sync ## Checklist - [ ] Tests updated - [ ] Documentation added - [x] `CHANGELOG.md` updated --------- Co-authored-by: Ildar Iskhakov <[email protected]>
1 parent 15e7baa commit 0c42c2a

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed
 

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## Unreleased
9+
10+
### Added
11+
12+
- Helm chart: add the option to use a helm hook for the migration job ([1386](https://github.com/grafana/oncall/pull/1386))
13+
814
## v1.2.11 (2023-04-14)
915

1016
### Added

‎helm/oncall/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: oncall
33
description: Developer-friendly incident response with brilliant Slack integration
44
type: application
5-
version: 1.2.8
6-
appVersion: v1.2.8
5+
version: 1.2.9
6+
appVersion: v1.2.9
77
dependencies:
88
- name: cert-manager
99
version: v1.8.0

‎helm/oncall/templates/engine/job-migrate.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
apiVersion: batch/v1
33
kind: Job
44
metadata:
5+
{{- if .Values.migrate.useHook }}
6+
name: {{ printf "%s-migrate" (include "oncall.engine.fullname" .) }}
7+
annotations:
8+
"helm.sh/hook": post-install,post-upgrade
9+
{{- else }}
510
name: {{ printf "%s-migrate-%s" (include "oncall.engine.fullname" .) (now | date "2006-01-02-15-04-05") }}
11+
{{- end }}
612
labels:
713
{{- include "oncall.engine.labels" . | nindent 4 }}
814
spec:

‎helm/oncall/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ migrate:
150150
enabled: true
151151
# TTL can be unset by setting ttlSecondsAfterFinished: ""
152152
ttlSecondsAfterFinished: 20
153+
# use a helm hook to manage the migration job
154+
useHook: false
153155

154156
# Additional env variables to add to deployments
155157
env: {}

0 commit comments

Comments
 (0)
Please sign in to comment.