From 44217fbb542bed199f3372bed50e54357922df69 Mon Sep 17 00:00:00 2001 From: Ramon de Klein Date: Thu, 29 Aug 2024 06:07:01 +0200 Subject: [PATCH] Allow existing secret (#2299) allow existing secret (#2298) --- helm/tenant/templates/tenant-configuration.yaml | 9 +++++++++ helm/tenant/values.yaml | 2 ++ 2 files changed, 11 insertions(+) diff --git a/helm/tenant/templates/tenant-configuration.yaml b/helm/tenant/templates/tenant-configuration.yaml index f54b83661e8..1638f9f7fa1 100644 --- a/helm/tenant/templates/tenant-configuration.yaml +++ b/helm/tenant/templates/tenant-configuration.yaml @@ -4,6 +4,7 @@ {{- if not (.Values.tenant.configSecret) }} {{- fail "# ERROR: '.tenant.configSecret' should be set." }} {{- else }} +{{- if not (.Values.tenant.configSecret.existingSecret) }} apiVersion: v1 kind: Secret @@ -15,6 +16,14 @@ stringData: export MINIO_ROOT_USER={{ .Values.tenant.configSecret.accessKey | quote }} export MINIO_ROOT_PASSWORD={{ .Values.tenant.configSecret.secretKey | quote }} +{{- else }} +{{- if (.Values.tenant.configSecret.accessKey) }} +{{- fail "# ERROR: cannot set access-key when an existing secret is used" }} +{{- end }} +{{- if (.Values.tenant.configSecret.secretKey) }} +{{- fail "# ERROR: cannot set secret-key when an existing secret is used" }} +{{- end }} +{{- end }} {{- end }} {{- end }} diff --git a/helm/tenant/values.yaml b/helm/tenant/values.yaml index d2ed263930a..f5946c662b7 100644 --- a/helm/tenant/values.yaml +++ b/helm/tenant/values.yaml @@ -68,6 +68,8 @@ tenant: name: myminio-env-configuration accessKey: minio secretKey: minio123 + #existingSecret: true + ### # If this variable is set to true, then enable the usage of an existing Kubernetes secret to set environment variables for the Tenant. # The existing Kubernetes secret name must be placed under .tenant.configuration.name e.g. existing-minio-env-configuration