Skip to content

Commit

Permalink
Remove deprecated .secret from tenant Helm chart (#2265)
Browse files Browse the repository at this point in the history
remove deprecated `.secret` from tenant Helm chart
  • Loading branch information
ramondeklein authored Aug 22, 2024
1 parent 97d95fa commit 3a8695b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 62 deletions.
28 changes: 10 additions & 18 deletions helm/tenant/templates/tenant-configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
{{- if (.Values.secrets) }}
{{- print "# WARNING: '.secrets' is deprecated since v5.0.15 and will be removed in next minor release (i.e. v5.1.0). Please use '.tenant.configSecret' instead." }}
{{- end }}
{{- if and (.Values.secrets) (.Values.tenant.configSecret) }}
{{- fail "ERROR: '.secrets' and '.tenant.configSecret' are mutually exclusive. Please use 'tenant.configSecret' instead." }}
{{- end }}
{{- if and (.Values.secrets) (not (.Values.secrets).existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ dig "secrets" "name" "" (.Values | merge (dict)) }}
type: Opaque
stringData:
config.env: |-
export MINIO_ROOT_USER={{ .Values.secrets.accessKey | quote }}
export MINIO_ROOT_PASSWORD={{ .Values.secrets.secretKey | quote }}
{{- end }}
{{- if and (.Values.tenant.configSecret) (not (.Values.tenant.configSecret).existingSecret) }}
{{- fail "# ERROR: '.secrets' is deprecated since v5.0.15 and has been removed. Please use '.tenant.configSecret' instead." }}
{{- else }}
{{- if not (.Values.tenant.configSecret) }}
{{- fail "# ERROR: '.tenant.configSecret' should be set." }}
{{- else }}

apiVersion: v1
kind: Secret
metadata:
Expand All @@ -25,4 +14,7 @@ stringData:
config.env: |-
export MINIO_ROOT_USER={{ .Values.tenant.configSecret.accessKey | quote }}
export MINIO_ROOT_PASSWORD={{ .Values.tenant.configSecret.secretKey | quote }}
{{- end }}
{{- end }}
{{- end }}

48 changes: 4 additions & 44 deletions helm/tenant/values.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
###
# WARNING: '.secrets' is deprecated since v6.0.2 and will be removed in next minor release (i.e. v5.1.0).
# WARNING: Please use '.tenant.configSecret' instead.
# Root key for dynamically creating a secret for use with configuring root MinIO User
# Specify the ``name`` and then a list of environment variables.
#
# .. important::
#
# Do not use this in production environments.
# This field is intended for use with rapid development or testing only.
#
# For example:
#
# .. code-block:: yaml
#
# name: myminio-env-configuration
# accessKey: minio
# secretKey: minio123
#
secrets:
name: myminio-env-configuration
accessKey: minio
secretKey: minio123
###
# If this variable is set, 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
# The secret must contain a key ``config.env``.
# The values should be a series of export statements to set environment variables for the Tenant.
# For example:
#
# .. code-block:: shell
#
# stringData:
# config.env: |-
# export MINIO_ROOT_USER=ROOTUSERNAME
# export MINIO_ROOT_PASSWORD=ROOTUSERPASSWORD
#
#existingSecret:
# name: enabled
###
# Root key for MinIO Tenant Chart
tenant:
###
Expand Down Expand Up @@ -104,10 +64,10 @@ tenant:
# accessKey: minio
# secretKey: minio123
#
# configSecret:
# name: myminio-env-configuration
# accessKey: minio
# secretKey: minio123
configSecret:
name: myminio-env-configuration
accessKey: minio
secretKey: minio123
###
# 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
Expand Down

0 comments on commit 3a8695b

Please sign in to comment.