Skip to content

Commit b3cd4bf

Browse files
authored
adapted the helm chart of initializer-job.yaml to allow for metadata … (#6730)
* adapted the helm chart of initializer-job.yaml to allow for metadata annotations * adapted the helm chart of initializer-job.yaml to run after install or upgrade * fixed typo initializerKeepSeconds to initializer.keepSeconds * renamed to jobAnnotations and moved helm hook to template values * indent fix * indent fix
1 parent 05d0c0a commit b3cd4bf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

helm/defectdojo/templates/initializer-job.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ metadata:
1010
app.kubernetes.io/instance: {{ .Release.Name }}
1111
app.kubernetes.io/managed-by: {{ .Release.Service }}
1212
helm.sh/chart: {{ include "defectdojo.chart" . }}
13+
annotations:
14+
{{- with .Values.initializer.jobAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
1317
spec:
14-
ttlSecondsAfterFinished: {{ .Values.initializerKeepSeconds }}
18+
ttlSecondsAfterFinished: {{ .Values.initializer.keepSeconds }}
1519
template:
1620
metadata:
1721
labels:

helm/defectdojo/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ django:
281281

282282
initializer:
283283
run: true
284+
jobAnnotations: {
285+
helm.sh/hook: "post-install,post-upgrade"
286+
}
284287
annotations: {}
285288
keepSeconds: 60
286289
affinity: {}

0 commit comments

Comments
 (0)