Skip to content

Commit 3f502ad

Browse files
chore: mount extraVolumes in initContainers too
1 parent 6794694 commit 3f502ad

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

helm/defectdojo/templates/initializer-job.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
- name: {{ . }}
4545
{{- end }}
4646
volumes:
47-
{{- if .Values.localsettingspy }}
47+
{{- if .Values.localsettingspy }}
4848
- name: localsettingspy
4949
configMap:
5050
name: {{ $fullName }}-localsettingspy
@@ -62,7 +62,7 @@ spec:
6262
{{- end }}
6363
{{- end }}
6464
initContainers:
65-
{{- if .Values.cloudsql.enabled }}
65+
{{- if .Values.cloudsql.enabled }}
6666
- name: cloudsql-proxy
6767
image: {{ .Values.cloudsql.image.repository }}:{{ .Values.cloudsql.image.tag }}
6868
imagePullPolicy: {{ .Values.cloudsql.image.pullPolicy }}
@@ -79,6 +79,13 @@ spec:
7979
{{- if .Values.cloudsql.use_private_ip }}
8080
- "-ip_address_types=PRIVATE"
8181
{{- end }}
82+
volumeMounts:
83+
{{- range .Values.initializer.extraVolumes }}
84+
- name: userconfig-{{ .name }}
85+
readOnly: true
86+
mountPath: {{ .path }}
87+
subPath: {{ .subPath }}
88+
{{- end }}
8289
{{- end }}
8390
- name: wait-for-db
8491
command:
@@ -103,6 +110,13 @@ spec:
103110
{{- end }}
104111
resources:
105112
{{- toYaml .Values.initializer.resources | nindent 10 }}
113+
volumeMounts:
114+
{{- range .Values.initializer.extraVolumes }}
115+
- name: userconfig-{{ .name }}
116+
readOnly: true
117+
mountPath: {{ .path }}
118+
subPath: {{ .subPath }}
119+
{{- end }}
106120
containers:
107121
- name: initializer
108122
image: "{{ template "initializer.repository" . }}:{{ .Values.tag }}"
@@ -112,7 +126,7 @@ spec:
112126
{{- toYaml .Values.securityContext.djangoSecurityContext | nindent 10 }}
113127
{{- end }}
114128
volumeMounts:
115-
{{- if .Values.localsettingspy }}
129+
{{- if .Values.localsettingspy }}
116130
- name: localsettingspy
117131
readOnly: true
118132
mountPath: /app/dojo/settings/local_settings.py

helm/defectdojo/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,9 @@ initializer:
383383
memory: 512Mi
384384
# Additional environment variables injected to the initializer job pods.
385385
extraEnv: []
386-
# Array of additional volume mount points for the initializer job pods.
386+
# Array of additional volume mount points for the initializer job (init)containers.
387387
extraVolumeMounts: []
388-
# A list of extra volumes to mount.
388+
# A list of extra volumes to attach to the initializer job pods.
389389
extraVolumes: []
390390

391391
# staticName defines whether name of the job will be the same (e.g., "defectdojo-initializer")

0 commit comments

Comments
 (0)