29648c05 by Adam Heath

Attempt to deal with failures during restore.

Refs: #BF-11765
1 parent 74f46752
......@@ -37,6 +37,17 @@ spec:
name: {{ include "postgresql-rclone.fullname" . }}-rclone
{{- end }}
initContainers:
- name: cleanup-pvc
image: "{{ .Values.bash.image.repository }}:{{ .Values.bash.image.tag }}"
imagePullPolicy: {{ .Values.bash.image.pullPolicy }}
volumeMounts:
- name: restores
mountPath: /restores
command:
- bash
- -cx
- |-
find /restores -delete
{{- if .Values.rclone.enabled }}
- name: rclone
image: "{{ .Values.rclone.image.repository }}:{{ .Values.rclone.image.tag }}"
......@@ -112,6 +123,8 @@ spec:
- bash
- -cx
- |-
set -- /restores/*
[[ -e $1 ]] || touch /restores/.error
touch /restores/.restored
......
......@@ -47,6 +47,8 @@ releases:
until [ -f /docker-entrypoint-initdb.d/.restored ]; do
sleep 5
done
if [ -f /docker-entrypoint-initdb.d/.error ]; then exit 1; fi
{{- range (.Values | get "primary.initContainers" list) }}
- {{ . | toYaml | nindent 14 }}
{{- end }}
......