Commit 31530457 authored by Waqar Ahmed's avatar Waqar Ahmed

Add configured certificate to minio secret

parent eaad608b
......@@ -4,3 +4,33 @@ Determine secret name.
{{- define "minio.secretName" -}}
{{- include "common.names.fullname" . -}}
{{- end -}}
{{/*
Retrieve true/false if minio certificate is configured
*/}}
{{- define "minio.certAvailable" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.certificate) -}}
{{- template "common.resources.cert_present" $values -}}
{{- end -}}
{{/*
Retrieve public key of minio certificate
*/}}
{{- define "minio.cert.publicKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.certificate "publicKey" true) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
{{/*
Retrieve private key of minio certificate
*/}}
{{- define "minio.cert.privateKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.certificate) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
......@@ -7,3 +7,7 @@ type: Opaque
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 -}}
certPublicKey: {{ template "minio.cert.publicKey" . }}
certPrivateKey: {{ template "minio.cert.privateKey" . }}
{{- end -}}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment