{{ if .Values.keycloak.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: prod-keycloak
  namespace: argocd
  annotations:
    argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  project: aux
  destination:
    server: https://kubernetes.default.svc
    namespace: keycloak
  syncPolicy:
    managedNamespaceMetadata:
      labels:
        component: aux
    syncOptions:
      - CreateNamespace=true
      - ApplyOutOfSyncOnly=true
    automated:
      prune: true
      selfHeal: true
  sources:
  - repoURL: https://gitlab.com/oceanbox/manifests.git
    targetRevision: main
    path: values/keycloak/prod
  - repoURL: https://charts.bitnami.com/bitnami
    targetRevision: 24.0.2
    chart: keycloak
    helm:
      valueFiles:
        - $values/values/keycloak/values-prod.yaml
  - repoURL: https://gitlab.com/oceanbox/manifests.git
    targetRevision: main
    ref: values
{{- end }}
