apiVersion: v1
kind: ConfigMap
metadata:
  name: argo-yam-plugin
  namespace: argocd
data:
  plugin.yaml: |
    # metadata file is in the root and shell executor knows about it
    apiVersion: argoproj.io/v1alpha1
    kind: ConfigManagementPlugin
    metadata:
      name: yam
    spec:
      version: v1.0
      init:
        command: [yam, version]
      generate:
        command: [sh, -c, "yam template --clusters ${DESTINATION} && cat template-output-*.yaml"]
      discover:
        find:
          glob: "**/*"
      allowConcurrency: true
      lockRepo: false