{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if and .Values.controlplane.keylessSigning.enabled (eq "ejbcaCA" .Values.controlplane.keylessSigning.backend) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "chainloop.controlplane.fullname" . }}-keyless-ejbca-ca
  labels:
    {{- include "chainloop.controlplane.labels" . | nindent 4 }}
type: Opaque
data:
  ejbca_client.cert: {{ .Values.controlplane.keylessSigning.ejbcaCA.clientCert | b64enc | quote }}
  ejbca_client.key: {{ .Values.controlplane.keylessSigning.ejbcaCA.clientKey | b64enc | quote }}
{{- end }}
