{{ if .Values.kubernetes_dashboard.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kubernetes-dashboard
  namespace: argocd
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  destination:
    namespace: kubernetes-dashboard
    server: 'https://kubernetes.default.svc'
  source:
    path: aio/deploy/recommended
    repoURL: https://github.com/kubernetes/dashboard
    targetRevision: {{ .Values.kubernetes_dashboard.version }}
  project: sys
  syncPolicy:
    managedNamespaceMetadata:
      labels:
        component: sys
    syncOptions:
      - CreateNamespace=true
      - ApplyOutOfSyncOnly=true
    {{- if .Values.kubernetes_dashboard.autosync }}
    automated:
      prune: true
      # selfHeal: false
    {{ end }}
{{ end }}
