{{- if and (.Values.global.enable_tls)
           (ne .Values.tlscerts.crt "") 
           (ne .Values.tlscerts.key "") 
           (ne .Values.tlscerts.cacert "") -}}
apiVersion: v1
kind: Secret
metadata:
  name: ironic-cacert
  labels:
    {{- include "ironic.labels" . | nindent 4 }}
type: Opaque 
data:
  tls.crt: {{ .Values.tlscerts.crt | toString | b64enc }}
  tls.key: {{ .Values.tlscerts.key | toString | b64enc }}
  ca.crt: {{ .Values.tlscerts.cacert | toString | b64enc }}  
{{- end }}
