Skip to content

Commit

Permalink
Allow customizing init job
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschwarzer committed May 21, 2024
1 parent 9fe0460 commit 6097da4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions zammad/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: zammad
version: 12.1.1
appVersion: 6.3.1
version: 12.2.0
appVersion: 6.3.1-4
description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails.
home: https://zammad.org
icon: https://raw.githubusercontent.com/zammad/zammad-documentation/main/images/zammad_logo_600x520.png
Expand Down
12 changes: 10 additions & 2 deletions zammad/templates/job-init.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "zammad.fullname" . }}-init-{{ uuidv4 }}
{{- if .Values.zammadConfig.initJob.randomName }}
# Use a different job name on each run to ensure a new job always runs once.
name: {{ include "zammad.fullname" . }}-init-{{ uuidv4 }}
{{- else }}
name: {{ include "zammad.fullname" . }}-init
{{- end}}
# Helm post-install/post-upgrade hooks cannot be used here, because
# helm's --wait flag causes a deadlock: the job waits for all resources to be ready,
# but the pods need the job to work properly.
labels:
{{- include "zammad.labels" . | nindent 4 }}
{{- with .Values.zammadConfig.initJob.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ttlSecondsAfterFinished: 300
template:
Expand Down Expand Up @@ -90,4 +98,4 @@ spec:
- name: {{ include "zammad.fullname" . }}-init
configMap:
name: {{ include "zammad.fullname" . }}-init
defaultMode: 0755
defaultMode: 0755
5 changes: 5 additions & 0 deletions zammad/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ zammadConfig:
customInit: ""
# bundle exec rails runner '…'

initJob:
randomName: true
annotations: { }

Check failure on line 359 in zammad/values.yaml

View workflow job for this annotation

GitHub Actions / lint-chart

359:19 [braces] too many spaces inside empty braces
# my-annotation: "value"

# additional environment vars added to all zammad services
extraEnv: []
# - name: FOO_BAR
Expand Down

0 comments on commit 6097da4

Please sign in to comment.