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

{{- $customCAs := .Values.controlplane.customCAs }}
{{- if (not (empty $customCAs)) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "chainloop.controlplane.fullname" . }}-custom-cas
  labels:
    {{- include "chainloop.controlplane.labels" . | nindent 4 }}
data: 
  {{- range $index, $pem := $customCAs }}
  custom-{{ $index }}.crt: {{ $pem | b64enc | quote }}
  {{- end -}}
{{- end -}}
