apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
  name: kustomize
spec:
  version: v1.0
  init:
    command: [sh, -c]
    args:
    - |
      kustomize version
  generate:
    command: [sh, -c]
    args:
    - |
      kustomize build
  discover:
    find:
      command: [sh, -c, find . -name kustomization.yaml]
      glob: "**/kustomization.yaml"
  parameters:
    static:
      - name: test-param
        string: test-value
    dynamic:
      command: [sh, -c]
      args:
        - |
          # Make sure env vars are making it to the plugin.
          if [ -z "$MUST_BE_SET" ]; then
            exit 1
          fi
          echo "[{\"name\": \"dynamic-test-param\", \"string\": \"$MUST_BE_SET\"}]"
