From c76f89b9ef20345b51eb3b904b80a35af6232973 Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski <janne@kuschku.de> Date: Thu, 26 May 2022 21:21:59 +0200 Subject: [PATCH] fix: define idempotent init hook --- restic/templates/cronjob.yaml | 4 ---- restic/templates/post-install-job.yaml | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/restic/templates/cronjob.yaml b/restic/templates/cronjob.yaml index 1924551..f530ad5 100644 --- a/restic/templates/cronjob.yaml +++ b/restic/templates/cronjob.yaml @@ -41,8 +41,6 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - - "-r" - - "{{ .Values.repository.name }}" - "forget" - "--prune" {{- toYaml .Values.keepOptions | nindent 16 }} @@ -59,8 +57,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} workingDir: "/sync" args: - - "-r" - - "{{ .Values.repository.name }}" - "backup" - "." envFrom: diff --git a/restic/templates/post-install-job.yaml b/restic/templates/post-install-job.yaml index 347202a..e21e17e 100644 --- a/restic/templates/post-install-job.yaml +++ b/restic/templates/post-install-job.yaml @@ -31,11 +31,11 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - workingDir: "/sync" + command: + - "/bin/sh" + - "-c" args: - - "-r" - - "{{ .Values.repository.name }}" - - "init" + - "restic cat config || restic init" envFrom: - secretRef: name: {{ include "restic-helm.fullname" . }} -- GitLab