{{- if .Values.server.otelConnector.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: {{ .Values.server.otelConnector.releaseName }}
  namespace: {{ .Values.namespaces.observability }}
spec:
  interval: 10m0s
  releaseName: {{ .Values.server.otelConnector.releaseName }}
  chart:
    spec:
      chart: {{ .Values.server.otelConnector.chart.name }}
      version: {{ .Values.server.otelConnector.chart.version | quote }}
      sourceRef:
        kind: {{ .Values.server.otelConnector.sourceRef.kind }}
        name: {{ .Values.server.otelConnector.sourceRef.name }}
        namespace: {{ .Values.server.otelConnector.sourceRef.namespace }}
  install:
    remediation:
      retries: 3
  upgrade:
    remediation:
      retries: 3
  values:
    {{- toYaml .Values.server.otelConnector.values | nindent 4 }}
{{- end }}
