diff --git a/charts/rclone-copy/templates/configmap.yaml b/charts/rclone-copy/templates/configmap.yaml index d516b7a..e857abe 100644 --- a/charts/rclone-copy/templates/configmap.yaml +++ b/charts/rclone-copy/templates/configmap.yaml @@ -3,5 +3,9 @@ kind: ConfigMap metadata: name: rclone-config-{{ .Release.Name }} data: + {{- if not .Values.secretConfig }} + rclone.conf: | +{{ .Values.rcloneConf | indent 4 }} + {{- end }} 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 f546594..b2ebe7d 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -69,11 +69,11 @@ spec: rclone {{ .Values.command }} -v {{ .Values.arguments | join " " }} --include-from /root/include-pattern.conf "{{ include "rclone-copy.getSourceOrUrl" . }}" "{{ .Values.sync.dest.name }}:{{ .Values.sync.dest.path }}" volumeMounts: - - name: config + - name: {{ .Values.secretConfig | ternary "secret-config" "config" }} # 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: include-config + - name: config mountPath: "/root/include-pattern.conf" subPath: "include-pattern.conf" @@ -100,10 +100,12 @@ spec: restartPolicy: {{ .Values.restartPolicy }} volumes: - - name: config + {{- if .Values.secretConfig }} + - name: secret-config secret: secretName: rclone-config-{{ .Release.Name }} - - name: include-config + {{- end }} + - name: config 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 1bc7839..ded72c1 100644 --- a/charts/rclone-copy/templates/secret.yaml +++ b/charts/rclone-copy/templates/secret.yaml @@ -1,3 +1,4 @@ +{{- if or .Values.configPassword .Values.secretConfig }} apiVersion: v1 kind: Secret metadata: @@ -7,4 +8,7 @@ data: {{- if .Values.configPassword }} password: {{ .Values.configPassword | b64enc }} {{- end }} + {{- if .Values.secretConfig }} rclone.conf: {{ .Values.rcloneConf | b64enc }} + {{- end }} +{{- end }} diff --git a/charts/rclone-copy/values.yaml b/charts/rclone-copy/values.yaml index aeb4ff3..1251608 100644 --- a/charts/rclone-copy/values.yaml +++ b/charts/rclone-copy/values.yaml @@ -90,3 +90,5 @@ secretRefs: {} # RCLONE_CONFIG_PASS: # name: secretName # key: secretKey + +secretConfig: true