Skip to content

Commit 27ba886

Browse files
authored
Fix issue with Helm configuration secret (#2412)
1 parent 5edabd0 commit 27ba886

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

helm/tenant/templates/checks.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{- with .Values.tenant }}
2+
3+
# If an existing secret is used, do not set access-key and secret-key explicitly
4+
# (note that we allow the default settings in values.yaml)
5+
{{- with .configSecret }}
6+
{{- if .existingSecret }}
7+
{{- if and .accessKey (ne .accessKey "minio") }}
8+
{{- fail "Cannot set access-key when an existing secret is used" }}
9+
{{- end }}
10+
{{- if and .secretKey (ne .secretKey "minio123") }}
11+
{{- fail "Cannot set secret-key when an existing secret is used" }}
12+
{{- end }}
13+
{{- end }}
14+
{{- end }}
15+
16+
# If configuration.name is set and not the same as configSecret.name,
17+
# then we should raise an error and abort
18+
{{- if and .configuration .configuration.name }}
19+
{{- if and .configSecret (ne .configuration.name .configSecret.name) -}}
20+
{{- fail "configuration.name is deprecated and doesn't match .tenant.configSecret.name" }}
21+
{{- end -}}
22+
{{- end }}
23+
24+
{{- end }}

helm/tenant/templates/tenant-configuration.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ stringData:
1616
export MINIO_ROOT_USER={{ .Values.tenant.configSecret.accessKey | quote }}
1717
export MINIO_ROOT_PASSWORD={{ .Values.tenant.configSecret.secretKey | quote }}
1818
19-
{{- else }}
20-
{{- if (.Values.tenant.configSecret.accessKey) }}
21-
{{- fail "# ERROR: cannot set access-key when an existing secret is used" }}
22-
{{- end }}
23-
{{- if (.Values.tenant.configSecret.secretKey) }}
24-
{{- fail "# ERROR: cannot set secret-key when an existing secret is used" }}
25-
{{- end }}
2619
{{- end }}
2720
{{- end }}
2821
{{- end }}

helm/tenant/templates/tenant.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
{{- end }}
3131
## Secret with default environment variable configurations
3232
configuration:
33-
name: {{ .configuration.name }}
33+
name: {{ .configSecret.name }}
3434
{{- if hasKey . "poolsMetadata" }}
3535
poolsMetadata: {{- if eq (len .poolsMetadata) 0 }} {} {{- end }}
3636
{{- with (dig "poolsMetadata" (dict) .) }}

helm/tenant/values.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ tenant:
6767
# Specify an empty dictionary ``{}`` to dispatch pods with the default scheduler.
6868
scheduler: { }
6969
###
70-
# The Kubernetes secret name that contains MinIO environment variable configurations.
71-
# The secret is expected to have a key named config.env containing environment variables exports.
72-
configuration:
73-
name: myminio-env-configuration
74-
###
7570
# Root key for dynamically creating a secret for use with configuring root MinIO User
7671
# Specify the ``name`` and then a list of environment variables.
7772
#

0 commit comments

Comments
 (0)