49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
{{- if ($.Values.customSecrets).enabled }}
|
|
{{- with .Values.customSecrets }}
|
|
{{- $hasLdapCrt := (hasKey $.Values.customSecrets "ldapCacert") -}}
|
|
{{- $hasBundleCrt := (hasKey . "bundleCacert") -}}
|
|
{{- if or $hasLdapCrt $hasBundleCrt }}
|
|
{{- $ldapCrtEnabled := ternary (.ldapCacert).enabled false $hasLdapCrt -}}
|
|
{{- $bundleCrtEnabled := ternary (.bundleCacert).enabled false $hasBundleCrt -}}
|
|
{{- $ldapSecretName := (include "ldapCacert.secretName" $) -}}
|
|
{{- $bundleSecretName := (include "bundleCacert.secretName" $) -}}
|
|
{{- if and (or $bundleCrtEnabled $ldapCrtEnabled) (eq $ldapSecretName $bundleSecretName) }}
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ $ldapSecretName }}
|
|
namespace: {{ $.Release.Namespace }}
|
|
type: Opaque
|
|
data:
|
|
{{- if $ldapCrtEnabled }}
|
|
ldap-ca.crt: {{ .ldapCacert.crt | required "customSecrets.ldapCacert.crt is required!" | b64enc }}
|
|
{{- end }}
|
|
{{- if $bundleCrtEnabled }}
|
|
bundle-ca.crt: {{ .bundleCacert.crt | required "customSecrets.bundleCacert.crt is required!" | b64enc }}
|
|
{{- end }}
|
|
{{- else }}
|
|
{{- if $ldapCrtEnabled }}
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ $ldapSecretName }}
|
|
namespace: {{ $.Release.Namespace }}
|
|
type: Opaque
|
|
data:
|
|
ldap-ca.crt: {{ .ldapCacert.crt | required "customSecrets.ldapCacert.crt is required!" | b64enc }}
|
|
{{- end }}
|
|
{{- if $bundleCrtEnabled }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ $bundleSecretName }}
|
|
namespace: {{ $.Release.Namespace }}
|
|
type: Opaque
|
|
data:
|
|
bundle-ca.crt: {{ .bundleCacert.crt | required "customSecrets.bundleCacert.crt is required!" | b64enc }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }} |