{{ if .Values.linkerd.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: linkerd-crds
  namespace: argocd
  #finalizers:
  #- resources-finalizer.argocd.argoproj.io
spec:
  ignoreDifferences:
    - group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      jsonPointers:
        - /spec/names/shortNames
  destination:
    namespace: linkerd
    server: 'https://kubernetes.default.svc'
  source:
    repoURL: 'https://helm.linkerd.io/stable'
    targetRevision: {{ .Values.linkerd.crds.version }}
    chart: linkerd-crds
  project: sys
  syncPolicy:
    managedNamespaceMetadata:
      labels:
        component: sys
    syncOptions:
      - CreateNamespace=true
      - ApplyOutOfSyncOnly=true
    {{- if .Values.linkerd.autosync }}
    automated:
      prune: true
      # selfHeal: false
    {{- end }}
{{ end }}
