mirror of
https://github.com/truenas/charts.git
synced 2026-04-06 04:09:32 +08:00
Add configured certificate to minio secret
This commit is contained in:
@@ -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 -}}
|
||||
|
||||
Reference in New Issue
Block a user