Skip to content

Commit

Permalink
Fix purge cronjob mounts, name
Browse files Browse the repository at this point in the history
  • Loading branch information
mfraezz committed Aug 21, 2020
1 parent 60496ef commit ca2c41d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions osf/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ pod.beta.kubernetes.io/init-containers: null
name: {{ $fullname }}-purge
key: {{ $key }}
{{- end }}
{{- range $key, $value := .Values.purge.secretEnvs }}
- name: {{ $key }}
valueFrom:
secretKeyRef:
name: {{ $fullname }}-purge
key: {{ $key }}
{{- end }}
{{- end -}}

{{- define "osf.certificates.initContainer" -}}
Expand Down
9 changes: 6 additions & 3 deletions osf/templates/purge-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ template "osf.purge.fullname" . }}-{{ .Release.Time.Seconds }}
name: {{ template "osf.purge.fullname" . }}
labels:
app: {{ template "osf.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Expand All @@ -11,7 +11,7 @@ metadata:
release: {{ .Release.Name }}
spec:
schedule: {{ default "0 22 * * 6" .Values.purge.schedule | quote }}
startingDeadlineSeconds: 900
startingDeadlineSeconds: {{ default 900 .Values.purge.startingDeadlineSeconds }}
activeDeadlineSeconds: {{ default 14400 .Values.purge.activeDeadlineSeconds }}
concurrencyPolicy: Forbid
jobTemplate:
Expand Down Expand Up @@ -53,7 +53,7 @@ spec:
command:
- /bin/sh
- -c
- python3 -m scripts.purge_trashed_files {{- if .Values.purge.num_records }} --num {{ .Values.purge.num_records }} {{- end }}
- su-exec www-data python3 -m scripts.purge_trashed_files {{- if .Values.purge.num_records }} --num {{ .Values.purge.num_records }} {{- end }}
env:
- name: DJANGO_SETTINGS_MODULE
value: api.base.settings
Expand All @@ -73,6 +73,9 @@ spec:
{{- end }}
volumes:
{{- include "osf.volumes" . | nindent 12 }}
- name: purge-secret
secret:
secretName: {{ include "osf.purge.fullname" .}}
- name: log
{{- if .Values.purge.persistence.enabled }}
persistentVolumeClaim:
Expand Down

0 comments on commit ca2c41d

Please sign in to comment.