apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: falco
spec:
  generators:
    - list:
        elements:
          - env: aws-dev-us-west-2
            cluster: dev-base-us-west-2
  template:
    metadata:
      name: "{{env}}-falco"
      labels:
        app: falco
        env: "{{env}}"
    spec:
      project: default
      sources:
        - repoURL: https://github.com/tidbcloud/app-delivery.git
          targetRevision: HEAD
          ref: values
        - repoURL: https://falcosecurity.github.io/charts
          chart: falco
          targetRevision: 9.1.0
          helm:
            releaseName: falco
            valueFiles:
              - $values/dev/nextgen-regional-control-plane/falco/envs/{{env}}/values.yaml
        - repoURL: https://github.com/tidbcloud/app-delivery.git
          targetRevision: HEAD
          path: dev/nextgen-regional-control-plane/falco/forwarder
      destination:
        name: "{{cluster}}"
        namespace: falco
      syncPolicy:
        automated:
          selfHeal: true
          prune: true
        syncOptions:
          - CreateNamespace=true
