Use with statement for readability

Signed-off-by: Marco Franssen <[email protected]>
Signed-off-by: Marco Franssen <[email protected]>
This commit is contained in:
Marco Franssen
2023-02-18 13:04:08 +01:00
committed by Marco Franssen
parent fe38a52a95
commit 786c6a5d89
+11 -8
View File
@@ -1,15 +1,18 @@
{{- if eq (.Values.server.config.upstreamAuthority.disk.enabled | toString) "true"}}
{{- $root := . }}
{{- with .Values.server.config.upstreamAuthority.disk }}
{{- if eq (.enabled | toString) "true" }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "spire.fullname" . }}-upstream-ca
namespace: {{ .Release.Namespace }}
name: {{ include "spire.fullname" $root }}-upstream-ca
namespace: {{ $root.Release.Namespace }}
labels:
{{- include "spire.server.labels" . | nindent 4 }}
{{- include "spire.server.labels" $root | nindent 4 }}
data:
tls.crt: {{ .Values.server.config.upstreamAuthority.disk.certificate | toYaml | indent 2 }}
tls.key: {{ .Values.server.config.upstreamAuthority.disk.key | toYaml | indent 2 }}
{{- if ne .Values.server.config.upstreamAuthority.disk.bundle ""}}
bundle.crt: {{ .Values.server.config.upstreamAuthority.disk.bundle | toYaml | indent 2 }}
tls.crt: {{ .certificate | toYaml | indent 2 }}
tls.key: {{ .key | toYaml | indent 2 }}
{{- if ne .bundle ""}}
bundle.crt: {{ .bundle | toYaml | indent 2 }}
{{- end }}
{{- end }}
{{- end }}