From eb6537e8f1f05556161a341dfbf89ec35f12311a Mon Sep 17 00:00:00 2001 From: kiblik <5609770+kiblik@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:54:41 +0100 Subject: [PATCH] feat(helm): Add support for staticName for initializer (#11237) --- helm/defectdojo/templates/_helpers.tpl | 4 ++++ helm/defectdojo/values.yaml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/helm/defectdojo/templates/_helpers.tpl b/helm/defectdojo/templates/_helpers.tpl index 14256e88190..c3e0026c2ef 100644 --- a/helm/defectdojo/templates/_helpers.tpl +++ b/helm/defectdojo/templates/_helpers.tpl @@ -102,8 +102,12 @@ Create chart name and version as used by the chart label. {{- end -}} {{- define "initializer.jobname" -}} +{{- if .Values.initializer.staticName -}} +{{ .Release.Name }}-initializer +{{- else -}} {{ .Release.Name }}-initializer-{{- printf "%s" now | date "2006-01-02-15-04" -}} {{- end -}} +{{- end -}} {{/* Creates the array for DD_ALLOWED_HOSTS in configmap diff --git a/helm/defectdojo/values.yaml b/helm/defectdojo/values.yaml index b2d0422bc2c..f480810d432 100644 --- a/helm/defectdojo/values.yaml +++ b/helm/defectdojo/values.yaml @@ -365,6 +365,11 @@ initializer: # @type: array extraVolumes: [] + # staticName defines whether name of the job will be the same (e.g., "defectdojo-initializer") + # or different every time - generated based on current time (e.g., "defectdojo-initializer-2024-11-11-18-57") + # This might be handy for ArgoCD deployments + staticName: false + postgresql: enabled: true auth: