From 980f2032c014e7dc32514209ec74f6424435199f Mon Sep 17 00:00:00 2001 From: Drew Hudson-Viles Date: Wed, 30 Oct 2024 10:47:05 +0000 Subject: [PATCH] fix: adding an environment value to enable the ignoring of the name, accessKey and secretKey in configSecret. In version 6.0.4 the inclusion of [this check](https://github.com/minio/operator/pull/2299/files#diff-1320c71ce4251e5e50c3b17c8aee11659e44a7208d1ab8d5c4f68694c02d9e80R20-R25) broke the ability to pass an existing secret because the default values provided in the values.yaml file, caused the error to trigger. Now we can presume in dev that the vluaes will be provided in line and in prod, they are provided via an existing secret. meh --- helm/tenant/templates/tenant-configuration.yaml | 2 ++ helm/tenant/values.yaml | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/helm/tenant/templates/tenant-configuration.yaml b/helm/tenant/templates/tenant-configuration.yaml index 1638f9f7fa1..74b167121ae 100644 --- a/helm/tenant/templates/tenant-configuration.yaml +++ b/helm/tenant/templates/tenant-configuration.yaml @@ -17,6 +17,7 @@ stringData: export MINIO_ROOT_PASSWORD={{ .Values.tenant.configSecret.secretKey | quote }} {{- else }} +{{- if eq .Values.tenant.environment "dev" }} {{- if (.Values.tenant.configSecret.accessKey) }} {{- fail "# ERROR: cannot set access-key when an existing secret is used" }} {{- end }} @@ -26,4 +27,5 @@ stringData: {{- end }} {{- end }} {{- end }} +{{- end }} diff --git a/helm/tenant/values.yaml b/helm/tenant/values.yaml index 1dcc4311502..1ddfaf7bc80 100644 --- a/helm/tenant/values.yaml +++ b/helm/tenant/values.yaml @@ -71,6 +71,15 @@ tenant: # The secret is expected to have a key named config.env containing environment variables exports. configuration: name: myminio-env-configuration + + ### + # The environment into which this tenant will be deployed. + # Valid options: + # + # environment: dev # will presume you are using the config secret in line as shown in the example below. + # environment: prod # will ignore the name, accessKey and secretKey fields if provided and enable the existingSecret value to be used. + environment: dev + ### # Root key for dynamically creating a secret for use with configuring root MinIO User # Specify the ``name`` and then a list of environment variables.