apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: openmetadata
  namespace: platform
spec:
  generators:
    - list:
        elements:
          - name: openmetadata-dependencies
            chartPath: manifests/helm/openmetadata-dependencies/1.12.1  
            valuesPath: openmetadata/dependencies-values.yaml 
            syncWave: "0"
          - name: openmetadata
            chartPath: manifests/helm/openmetadata/1.12.1               
            valuesPath: openmetadata/openmeta-values.yaml              
            syncWave: "1"
  template:
    metadata:
      name: "{{name}}"
      namespace: argocd
      annotations:
        argocd.argoproj.io/sync-wave: "{{syncWave}}"
    spec:
      project: default
      sources:
        - repoURL: https://gitea.example.org/dip/catalog-test
          targetRevision: main
          path: "{{chartPath}}"
          helm:
            valueFiles:
              - $values/{{valuesPath}} 
        - repoURL: https://gitea.example.org/dip/values-test
          targetRevision: main
          ref: values                 
      destination:
        server: https://kubernetes.default.svc
        namespace: open-metadata
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
        syncOptions:
          - CreateNamespace=true
          - ServerSideApply=true
        retry:
          limit: 5
          backoff:
            duration: 10s
            factor: 2
            maxDuration: 3m