argoproj-labs / argocd-vault-plugin

An Argo CD plugin to retrieve secrets from Secret Management tools and inject them into Kubernetes secrets
https://argocd-vault-plugin.readthedocs.io
Apache License 2.0
808 stars 191 forks source link

Suport parameters for Argo CD custom plugins #562

Open abirsigron opened 11 months ago

abirsigron commented 11 months ago

TLDR Migrating the argocd-application template from helm source to argocd-vault-plugin source is complicated. With the feature I suggest here it should be much easier:

We are currently using helm source for our argo applications which look like:

  source:
    helm:
      parameters:
        - name: globalValues.region
          value: us-east-1
      valueFiles:
        - values/test.yaml
        - values/actions-runner-controller.yaml
      skipCrds: false

In order to use the plugin we need to pass env variable with the relevant helm arguments:

 source:
    plugin:
      name: argocd-vault-plugin-helm
      env:
        - name: HELM_ARGS
          value: "-f values/test.yaml -f values/actions-runner-controller.yaml --set globalValues.region=us-east-1"

I think it will be helpful and much more clear if argocd-vault-plugin will support the same parameters as the helm source. For example:

  source:
    plugin:
      name: argocd-vault-plugin-helm
      parameters:
        - name: globalValues.region
          value: us-east-1
      valueFiles:
        - values/test.yaml
        - values/actions-runner-controller.yaml
      skipCrds: false
werne2j commented 11 months ago

AVP has no control over the arguments that a custom plugin can take. That is determined by Argo CD itself https://argo-cd.readthedocs.io/en/stable/operator-manual/config-management-plugins/#using-environment-variables-in-your-plugin.

So AVP could only accept env and/or parameters attributes. That being said the plugin does not support the parameters option at the moment.

AVP is just a binary that runs under the control of the Argo CD custom config plugins

werne2j commented 10 months ago

Will use this issue to track any work for supporting parameters