{{- if and .Values.certs.client.key .Values.certs.client.crt .Values.certs.ca.crt }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "falco.fullname" . }}-client-certs
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "falco.labels" $ | nindent 4 }}
type: Opaque
data:
  {{ $key := .Values.certs.client.key }}
  client.key: {{ $key | b64enc | quote }}
  {{ $crt := .Values.certs.client.crt }}
  client.crt: {{ $crt | b64enc | quote }}
  falcoclient.pem: {{ print $key $crt | b64enc | quote }}
  ca.crt: {{ .Values.certs.ca.crt | b64enc | quote }}
  ca.pem: {{ .Values.certs.ca.crt | b64enc | quote }}
{{- end }}
