Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to use helm hook for migration job #1386

Merged
merged 4 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add option to use helm hook for migration job
  • Loading branch information
Mattes83 committed Apr 14, 2023
commit 072c4d0a9262e80dcfcbff52195abfcb9329fe57
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions helm/oncall/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions helm/oncall/templates/engine/job-migrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions helm/oncall/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down