From a2a8544ff8b975372506d0a321cf29a4ededb64d Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 13:20:15 +0200 Subject: [PATCH] Move rclone.conf to Kubernetes secret Fixes #3 --- charts/rclone-copy/templates/configmap.yaml | 2 -- charts/rclone-copy/templates/rclone-cron.yaml | 5 ++++- charts/rclone-copy/templates/secret.yaml | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/rclone-copy/templates/configmap.yaml b/charts/rclone-copy/templates/configmap.yaml index 6255f67..d516b7a 100644 --- a/charts/rclone-copy/templates/configmap.yaml +++ b/charts/rclone-copy/templates/configmap.yaml @@ -3,7 +3,5 @@ kind: ConfigMap metadata: name: rclone-config-{{ .Release.Name }} data: - rclone.conf: | -{{ .Values.rcloneConf | indent 4 }} include-pattern.conf: | {{ .Values.includePattern | indent 4 }} diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index 73b36d1..8f072a9 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -72,7 +72,7 @@ spec: # This is the default path where the rclone implementation assumes the config is located mountPath: "/root/.config/rclone/rclone_ro.conf" subPath: "rclone.conf" - - name: config + - name: includeConfig mountPath: "/root/include-pattern.conf" subPath: "include-pattern.conf" @@ -91,6 +91,9 @@ spec: restartPolicy: {{ .Values.restartPolicy }} volumes: - name: config + secret: + secretName: rclone-config-{{ .Release.Name }} + - name: includeConfig configMap: name: rclone-config-{{ .Release.Name }} backoffLimit: {{ .Values.backoffLimit }} diff --git a/charts/rclone-copy/templates/secret.yaml b/charts/rclone-copy/templates/secret.yaml index ca6de3d..af9948a 100644 --- a/charts/rclone-copy/templates/secret.yaml +++ b/charts/rclone-copy/templates/secret.yaml @@ -1,9 +1,10 @@ -{{- if .Values.configPassword }} apiVersion: v1 kind: Secret metadata: name: rclone-config-{{ .Release.Name }} type: Opaque data: + {{- if .Values.configPassword }} password: {{ .Values.configPassword | b64enc }} -{{- end }} + {{- end }} + rclone.conf: {{ .Values.rcloneConf | nindent 4 }}