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

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