diff --git a/charts/paperlessngx-ftp-bridge/Chart.yaml b/charts/paperlessngx-ftp-bridge/Chart.yaml index bd492c1..a5dbb67 100644 --- a/charts/paperlessngx-ftp-bridge/Chart.yaml +++ b/charts/paperlessngx-ftp-bridge/Chart.yaml @@ -15,7 +15,7 @@ sources: - https://github.com/taskmedia/helm icon: https://media.task.media/images/logo.png type: application -version: 2.0.2 +version: 2.0.3 # app image tag (v); bumped manually when the bridge repo releases appVersion: "2.1.1" @@ -30,5 +30,5 @@ annotations: - name: paperlessngx-ftp-bridge image: ghcr.io/taskmedia/paperlessngx-ftp-bridge-image:v2.1.1 artifacthub.io/changes: | - - kind: changed - description: Add Artifact Hub metadata (category, links, images) + - kind: fixed + description: Only create the Secret when an inline password is configured diff --git a/charts/paperlessngx-ftp-bridge/templates/secrets.yaml b/charts/paperlessngx-ftp-bridge/templates/secrets.yaml index 756c12a..870134b 100644 --- a/charts/paperlessngx-ftp-bridge/templates/secrets.yaml +++ b/charts/paperlessngx-ftp-bridge/templates/secrets.yaml @@ -1,14 +1,21 @@ +{{- $data := dict }} +{{- range $i, $account := .Values.ftp.accounts }} +{{- $existingSecret := $account.passwordExistingSecret | default dict }} +{{- if and $account.password (not $existingSecret.name) }} +{{- $_ := set $data (printf "ftp-account-%d-password" $i) $account.password }} +{{- end }} +{{- end }} +{{- if and .Values.paperless.password (not .Values.paperless.passwordExistingSecret.name) }} +{{- $_ := set $data "paperless-password" .Values.paperless.password }} +{{- end }} +{{- if $data }} apiVersion: v1 kind: Secret metadata: name: "{{ include "plngxftpbridge.fullname" . }}" type: Opaque stringData: - {{- range $i, $account := .Values.ftp.accounts }} - {{- if $account.password }} - ftp-account-{{ $i }}-password: {{ $account.password | quote }} - {{- end }} - {{- end }} - {{- if .Values.paperless.password }} - paperless-password: {{ .Values.paperless.password | quote }} + {{- range $key, $value := $data }} + {{ $key }}: {{ $value | quote }} {{- end }} +{{- end }}