diff --git a/test/minio/1.3.11/questions.yaml b/test/minio/1.3.11/questions.yaml index 62571b70b4..c426bb7322 100644 --- a/test/minio/1.3.11/questions.yaml +++ b/test/minio/1.3.11/questions.yaml @@ -147,7 +147,7 @@ questions: schema: type: string default: null - null: true + "null": true show_if: [["certificate", "!=", null]] - variable: certificate diff --git a/test/minio/1.3.11/templates/_helpers.tpl b/test/minio/1.3.11/templates/_helpers.tpl index f4d59c96f8..dc65a42ead 100644 --- a/test/minio/1.3.11/templates/_helpers.tpl +++ b/test/minio/1.3.11/templates/_helpers.tpl @@ -38,3 +38,15 @@ Retrieve private key of minio certificate {{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}} {{ include "common.resources.cert" $values }} {{- end -}} + + +{{/* +Retrieve scheme/protocol for minio +*/}} +{{- define "minio.scheme" -}} +{{- if eq (include "minio.certAvailable" .) "true" -}} +{{- print "https" -}} +{{- else -}} +{{- print "http" -}} +{{- end -}} +{{- end -}} diff --git a/test/minio/1.3.11/templates/configmap.yaml b/test/minio/1.3.11/templates/configmap.yaml index 0c9aeea644..98a62a3890 100644 --- a/test/minio/1.3.11/templates/configmap.yaml +++ b/test/minio/1.3.11/templates/configmap.yaml @@ -1,10 +1,6 @@ -{{ $scheme := "http" }} -{{ if eq (include "minio.certAvailable" .) "true" }} -{{ $scheme = "https" }} -{{ end }} apiVersion: v1 kind: ConfigMap metadata: name: minio-config data: - protocol: {{ $scheme }} + protocol: {{ include "minio.scheme" . }} diff --git a/test/minio/1.3.11/templates/deployment.yaml b/test/minio/1.3.11/templates/deployment.yaml index 18573a26d9..a18a71893c 100644 --- a/test/minio/1.3.11/templates/deployment.yaml +++ b/test/minio/1.3.11/templates/deployment.yaml @@ -43,8 +43,8 @@ spec: {{ $secretName := (include "minio.secretName" .) }} {{ $envList := (default list .Values.environmentVariables) }} {{ if .Values.minioDomain }} - {{ $envList = mustAppend $envList (dict "name" "MINIO_BROWSER_REDIRECT_URL" "value" (printf "https://%s:%d" .Values.minioDomain .Values.service.consolePort)) }} - {{ $envList = mustAppend $envList (dict "name" "MINIO_SERVER_URL" "value" (printf "https://%s:%d" .Values.minioDomain .Values.service.nodePort)) }} + {{ $envList = mustAppend $envList (dict "name" "MINIO_BROWSER_REDIRECT_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.consolePort | int))) }} + {{ $envList = mustAppend $envList (dict "name" "MINIO_SERVER_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.nodePort | int))) }} {{ end }} {{ $envList = mustAppend $envList (dict "name" "MINIO_ACCESS_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }} {{ $envList = mustAppend $envList (dict "name" "MINIO_SECRET_KEY" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }} diff --git a/test/minio/1.3.11/templates/secrets.yaml b/test/minio/1.3.11/templates/secrets.yaml index bb66428cde..4085fd585b 100644 --- a/test/minio/1.3.11/templates/secrets.yaml +++ b/test/minio/1.3.11/templates/secrets.yaml @@ -8,9 +8,6 @@ data: accesskey: {{ if .Values.accessKey }}{{ .Values.accessKey | toString | b64enc | quote }}{{ else }}{{ randAlphaNum 20 | b64enc | quote }}{{ end }} secretkey: {{ if .Values.secretKey }}{{ .Values.secretKey | toString | b64enc | quote }}{{ else }}{{ randAlphaNum 40 | b64enc | quote }}{{ end }} {{ if eq (include "minio.certAvailable" .) "true" }} - {{ if eq .Values.minioDomain null }} - {{ fail "Minio Domain must be specified when TLS is configured" }} - {{ end }} certPublicKey: {{ (include "minio.cert.publicKey" .) | toString | b64enc | quote }} certPrivateKey: {{ (include "minio.cert.privateKey" .) | toString | b64enc | quote }} {{ end }}