From 71010bf68297326349e71a086485bf6e3ecc4148 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Fri, 9 Aug 2024 11:45:24 +0200 Subject: [PATCH] Reference existing secret for Rclone config password --- charts/rclone-copy/templates/rclone-cron.yaml | 11 ++++++++++- charts/rclone-copy/values.yaml | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index 8cb310d..820bc70 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -79,14 +79,23 @@ spec: resources: {{ toYaml .Values.resources | indent 14 }} - {{- if .Values.configPassword }} + {{- if or .Values.configPassword .Values.secretRefs }} env: + {{- if .Values.configPassword }} - name: RCLONE_CONFIG_PASS valueFrom: secretKeyRef: name: rclone-config-{{ .Release.Name }} key: password {{- end }} + {{- range $key, $value := .Values.secretRefs }} + - name: "{{ $key }}" + valueFrom: + secretKeyRef: + name: {{ $value.name }} + key: "{{ $value.key }}" + {{- end }} + {{- end }} restartPolicy: {{ .Values.restartPolicy }} volumes: diff --git a/charts/rclone-copy/values.yaml b/charts/rclone-copy/values.yaml index 518cbea..89cf87c 100644 --- a/charts/rclone-copy/values.yaml +++ b/charts/rclone-copy/values.yaml @@ -78,3 +78,8 @@ podAnnotations: {} podLabels: {} # configPassword: password + +secretRefs: {} +# RCLONE_CONFIG_PASS: +# name: secretName +# key: secretKey