{{- range $value := .Values.applications }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: {{ $value.name }}
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  destination:
    namespace: {{ $value.namespace }}
    name: {{ $value.cluster }}  # Uncomment and use this line
    # server: https://kubernetes.default.svc  # Alternatively, use this line
  project: default
  source:
    path: {{ $value.path }}
    repoURL: {{ $value.repoURL }}
    targetRevision: HEAD
    helm:
      valueFiles:
        - vcluster.yaml
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
---
{{- end }}