Skip to content

Commit 6794694

Browse files
fix: PR review suggestions
1 parent 7bd3273 commit 6794694

File tree

6 files changed

+37
-18
lines changed

6 files changed

+37
-18
lines changed

helm/defectdojo/templates/celery-beat-deployment.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ metadata:
1313
{{- with .Values.extraLabels }}
1414
{{- toYaml . | nindent 4 }}
1515
{{- end }}
16-
{{- with .Values.celery.worker.annotations }}
16+
{{- with mergeOverwrite .Values.celery.annotations .Values.celery.beat.annotations }}
1717
annotations:
1818
{{- toYaml . | nindent 4 }}
1919
{{- end }}
2020
spec:
2121
replicas: {{ .Values.celery.beat.replicas }}
22-
{{- if .Values.revisionHistoryLimit }}
23-
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
22+
{{- with .Values.revisionHistoryLimit }}
23+
revisionHistoryLimit: {{ . }}
2424
{{- end }}
2525
selector:
2626
matchLabels:
@@ -42,7 +42,7 @@ spec:
4242
{{- toYaml . | nindent 8 }}
4343
{{- end }}
4444
annotations:
45-
{{- with .Values.celery.beat.annotations }}
45+
{{- with mergeOverwrite .Values.celery.annotations .Values.celery.beat.podAnnotations }}
4646
{{- toYaml . | nindent 8 }}
4747
{{- end }}
4848
{{- if eq (.Values.trackConfig | default "disabled") "enabled" }}
@@ -52,9 +52,9 @@ spec:
5252
{{- end }}
5353
spec:
5454
serviceAccountName: {{ include "defectdojo.serviceAccountName" . }}
55-
{{- if .Values.imagePullSecrets }}
55+
{{- with .Values.imagePullSecrets }}
5656
imagePullSecrets:
57-
- name: {{ .Values.imagePullSecrets }}
57+
- name: {{ . }}
5858
{{- end }}
5959
volumes:
6060
- name: run

helm/defectdojo/templates/celery-worker-deployment.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ metadata:
1313
{{- with .Values.extraLabels }}
1414
{{- toYaml . | nindent 4 }}
1515
{{- end }}
16-
{{- with .Values.celery.worker.annotations }}
16+
{{- with mergeOverwrite .Values.celery.annotations .Values.celery.worker.annotations }}
1717
annotations:
1818
{{- toYaml . | nindent 4 }}
1919
{{- end }}
2020
spec:
2121
replicas: {{ .Values.celery.worker.replicas }}
22-
{{- if .Values.revisionHistoryLimit }}
23-
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
22+
{{- with .Values.revisionHistoryLimit }}
23+
revisionHistoryLimit: {{ . }}
2424
{{- end }}
2525
selector:
2626
matchLabels:
@@ -42,7 +42,7 @@ spec:
4242
{{- toYaml . | nindent 8 }}
4343
{{- end }}
4444
annotations:
45-
{{- with .Values.celery.worker.annotations }}
45+
{{- with mergeOverwrite .Values.celery.annotations .Values.celery.worker.podAnnotations }}
4646
{{- toYaml . | nindent 8 }}
4747
{{- end }}
4848
{{- if eq (.Values.trackConfig | default "disabled") "enabled" }}
@@ -52,9 +52,9 @@ spec:
5252
{{- end }}
5353
spec:
5454
serviceAccountName: {{ include "defectdojo.serviceAccountName" . }}
55-
{{- if .Values.imagePullSecrets }}
55+
{{- with .Values.imagePullSecrets }}
5656
imagePullSecrets:
57-
- name: {{ .Values.imagePullSecrets }}
57+
- name: {{ . }}
5858
{{- end }}
5959
volumes:
6060
{{- if .Values.localsettingspy }}
@@ -67,7 +67,7 @@ spec:
6767
configMap:
6868
name: {{ .Values.django.uwsgi.certificates.configName }}
6969
{{- end }}
70-
{{- with .Values.celery.beat.extraVolumes }}
70+
{{- with .Values.celery.worker.extraVolumes }}
7171
{{- . | toYaml | nindent 6 }}
7272
{{- end }}
7373
{{- if coalesce .Values.dbMigrationChecker.enabled .Values.cloudsql.enabled .Values.celery.worker.extraInitContainers }}

helm/defectdojo/templates/configmap.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- $fullName := include "defectdojo.fullname" . -}}
2+
{{- $defaultBrokerParams := ternary "ssl_cert_reqs=optional" "" .Values.redis.tls.enabled -}}
23
apiVersion: v1
34
kind: ConfigMap
45
metadata:
@@ -28,7 +29,7 @@ data:
2829
DD_CELERY_BROKER_USER: ''
2930
DD_CELERY_BROKER_HOST: {{ if eq .Values.celery.broker "redis" }}{{ template "redis.hostname" . }}{{ end }}
3031
DD_CELERY_BROKER_PORT: '{{ if eq .Values.celery.broker "redis" }}{{- if ( hasKey .Values.redis "master" ) -}}{{ .Values.redis.master.service.ports.redis }}{{ else }}6379{{ end }}{{- end -}}'
31-
DD_CELERY_BROKER_PARAMS: '{{ if eq .Values.celery.broker "redis" }}{{- if .Values.redis.tls.enabled -}}{{ .Values.celery.brokerParams | default "ssl_cert_reqs=optional" }}{{ end }}{{ end }}'
32+
DD_CELERY_BROKER_PARAMS: '{{ .Values.celery.brokerParams | default $defaultBrokerParams }}'
3233
DD_CELERY_BROKER_PATH: '{{ .Values.celery.path | default "//" }}'
3334
DD_CELERY_LOG_LEVEL: {{ .Values.celery.logLevel }}
3435
DD_CELERY_WORKER_POOL_TYPE: {{ .Values.celery.worker.appSettings.poolType | default "solo" }}

helm/defectdojo/templates/initializer-job.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ spec:
3939
{{- end }}
4040
spec:
4141
serviceAccountName: {{ include "defectdojo.serviceAccountName" . }}
42-
{{- if .Values.imagePullSecrets }}
42+
{{- with .Values.imagePullSecrets }}
4343
imagePullSecrets:
44-
- name: {{ .Values.imagePullSecrets }}
44+
- name: {{ . }}
4545
{{- end }}
4646
volumes:
4747
{{- if .Values.localsettingspy }}
@@ -129,6 +129,9 @@ spec:
129129
envFrom:
130130
- configMapRef:
131131
name: {{ $fullName }}
132+
- secretRef:
133+
name: {{ $fullName }}
134+
optional: true
132135
- secretRef:
133136
name: {{ $fullName }}-extrasecrets
134137
optional: true

helm/defectdojo/templates/tests/unit-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ metadata:
1212
helm.sh/hook: test-success
1313
spec:
1414
serviceAccountName: {{ include "defectdojo.serviceAccountName" . }}
15-
{{- if .Values.imagePullSecrets }}
15+
{{- with .Values.imagePullSecrets }}
1616
imagePullSecrets:
17-
- name: {{ .Values.imagePullSecrets }}
17+
- name: {{ . }}
1818
{{- end }}
1919
containers:
2020
- name: unit-tests

helm/defectdojo/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ celery:
153153
# Parameters attached to the broker URL, defaults to "ssl_cert_reqs=optional" if redis.tls.enabled
154154
brokerParams: ""
155155
logLevel: INFO
156+
# Common annotations to worker and beat deployments and pods.
156157
annotations: {}
157158
beat:
159+
# Annotations for the Celery beat deployment.
158160
annotations: {}
159161
affinity: {}
160162
# Additional environment variables injected to Celery beat containers.
@@ -177,6 +179,10 @@ celery:
177179
# periodSeconds: 60
178180
# timeoutSeconds: 10
179181
nodeSelector: {}
182+
# Annotations for the Celery beat pods.
183+
podAnnotations: {}
184+
# Enable readiness probe for Celery beat container.
185+
readinessProbe: {}
180186
replicas: 1
181187
resources:
182188
requests:
@@ -185,8 +191,11 @@ celery:
185191
limits:
186192
cpu: 2000m
187193
memory: 256Mi
194+
# Enable startup probe for Celery beat container.
195+
startupProbe: {}
188196
tolerations: []
189197
worker:
198+
# Annotations for the Celery worker deployment.
190199
annotations: {}
191200
affinity: {}
192201
# Additional environment variables injected to Celery worker containers.
@@ -209,6 +218,10 @@ celery:
209218
# periodSeconds: 60
210219
# timeoutSeconds: 10
211220
nodeSelector: {}
221+
# Annotations for the Celery beat pods.
222+
podAnnotations: {}
223+
# Enable readiness probe for Celery worker container.
224+
readinessProbe: {}
212225
replicas: 1
213226
resources:
214227
requests:
@@ -217,6 +230,8 @@ celery:
217230
limits:
218231
cpu: 2000m
219232
memory: 512Mi
233+
# Enable startup probe for Celery worker container.
234+
startupProbe: {}
220235
tolerations: []
221236
appSettings:
222237
poolType: solo

0 commit comments

Comments
 (0)