Skip to content

Commit 3ef2574

Browse files
committed
Fix purge cronjob mounts
1 parent 60496ef commit 3ef2574

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

osf/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ pod.beta.kubernetes.io/init-containers: null
277277
name: {{ $fullname }}-purge
278278
key: {{ $key }}
279279
{{- end }}
280+
{{- range $key, $value := .Values.purge.secretEnvs }}
281+
- name: {{ $key }}
282+
valueFrom:
283+
secretKeyRef:
284+
name: {{ $fullname }}-purge
285+
key: {{ $key }}
286+
{{- end }}
280287
{{- end -}}
281288

282289
{{- define "osf.certificates.initContainer" -}}

osf/templates/purge-cronjob.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
release: {{ .Release.Name }}
1212
spec:
1313
schedule: {{ default "0 22 * * 6" .Values.purge.schedule | quote }}
14-
startingDeadlineSeconds: 900
14+
startingDeadlineSeconds: {{ default 900 .Values.purge.startingDeadlineSeconds }}
1515
activeDeadlineSeconds: {{ default 14400 .Values.purge.activeDeadlineSeconds }}
1616
concurrencyPolicy: Forbid
1717
jobTemplate:
@@ -53,7 +53,7 @@ spec:
5353
command:
5454
- /bin/sh
5555
- -c
56-
- python3 -m scripts.purge_trashed_files {{- if .Values.purge.num_records }} --num {{ .Values.purge.num_records }} {{- end }}
56+
- su-exec www-data python3 -m scripts.purge_trashed_files {{- if .Values.purge.num_records }} --num {{ .Values.purge.num_records }} {{- end }}
5757
env:
5858
- name: DJANGO_SETTINGS_MODULE
5959
value: api.base.settings
@@ -73,6 +73,9 @@ spec:
7373
{{- end }}
7474
volumes:
7575
{{- include "osf.volumes" . | nindent 12 }}
76+
- name: purge-secret
77+
secret:
78+
secretName: {{ include "osf.purge.fullname" .}}
7679
- name: log
7780
{{- if .Values.purge.persistence.enabled }}
7881
persistentVolumeClaim:

0 commit comments

Comments
 (0)