{{- if and .Values.tls.caBundle.enabled .Values.tls.caBundle.content -}}
---
apiVersion: v1
kind: {{ .Values.tls.caBundle.useSecret | ternary "Secret" "ConfigMap" }}
metadata:
  name: {{ .Values.tls.caBundle.name }}
  namespace: {{ include "cilium.namespace" . }}
  {{- with .Values.commonLabels }}
  labels:
    {{- toYaml . | nindent 4 }}
  {{- end }}

{{ .Values.tls.caBundle.useSecret | ternary "stringData" "data" }}:
  {{ .Values.tls.caBundle.key }}: |
    {{- .Values.tls.caBundle.content | nindent 4 }}
{{- end }}
