{{ if .Values.dex.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: prod-dex
  namespace: argocd
spec:
  project: aux
  destination:
    server: https://kubernetes.default.svc
    namespace: dex
  sources:
  - repoURL: https://gitlab.com/oceanbox/manifests.git
    targetRevision: main
    path: 'values/dex/prod'
  - repoURL: https://gitlab.com/oceanbox/manifests.git
    targetRevision: main
    path: values/dex/resources
  - repoURL: https://charts.dexidp.io
    targetRevision: 0.19.1
    chart: dex
    helm:
      valueFiles:
        - $values/values/dex/values.yaml
        - $values/values/dex/values-prod.yaml
  - repoURL: https://gitlab.com/oceanbox/manifests.git
    targetRevision: main
    ref: values
{{- end }}
