Skip to content

Commit 6bcc3df

Browse files
committed
Use full chart version in job name to improve Argo compat.
Allow people to disable ttlSecondsAfterFinished but default to setting it as it's best practise to avoid orphaned pods hanging around. Based on #792. Documentation changes to follow.
1 parent 3ced297 commit 6bcc3df

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

charts/temporal/templates/server-job.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
{{- $jobName := include "temporal.componentname" (list $ (printf "schema-%d-%d" $.Chart.Version $.Release.Revision | replace "." "-")) }}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
4-
name: {{ include "temporal.componentname" (list $ (printf "schema-%d" .Release.Revision | replace "." "-")) }}
5+
name: {{ $jobName }}
56
labels:
67
{{- include "temporal.resourceLabels" (list $ "database" "") | nindent 4 }}
78
{{- with $.Values.schema.jobAnnotations }}
@@ -10,10 +11,10 @@ metadata:
1011
{{- end }}
1112
spec:
1213
backoffLimit: {{ $.Values.schema.backoffLimit }}
13-
ttlSecondsAfterFinished: 86400
14+
ttlSecondsAfterFinished: {{ $.Values.schema.ttlSecondsAfterFinished }}
1415
template:
1516
metadata:
16-
name: {{ include "temporal.componentname" (list $ (printf "schema-%d" .Release.Revision | replace "." "-")) }}
17+
name: {{ $jobName }}
1718
labels:
1819
{{- include "temporal.resourceLabels" (list $ "database" "") | nindent 8 }}
1920
{{- with $.Values.schema.podLabels }}

charts/temporal/tests/server_job_test.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,29 @@ tests:
196196
- equal:
197197
path: spec.template.metadata.labels.custom-pod-label
198198
value: ghi
199+
- it: sets backoffLimit and ttlSecondsAfterFinished on the job
200+
set:
201+
server:
202+
config:
203+
persistence:
204+
datastores:
205+
default:
206+
sql:
207+
pluginName: mysql8
208+
connectAddr: "temporal-persistence:3306"
209+
databaseName: temporal
210+
visibility:
211+
sql:
212+
pluginName: mysql8
213+
connectAddr: "temporal-visibility:3306"
214+
databaseName: temporal_visibility
215+
schema:
216+
backoffLimit: 5
217+
ttlSecondsAfterFinished: 3600
218+
asserts:
219+
- equal:
220+
path: spec.backoffLimit
221+
value: 5
222+
- equal:
223+
path: spec.ttlSecondsAfterFinished
224+
value: 3600

charts/temporal/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ web:
508508
podDisruptionBudget: {}
509509
schema:
510510
backoffLimit: 100
511+
ttlSecondsAfterFinished: 86400
511512
jobAnnotations: {}
512513
podAnnotations: {}
513514
podLabels: {}

0 commit comments

Comments
 (0)