argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.81k stars 5.44k forks source link

Application env vars missing in configManagementPlugins #1950

Closed msiebeneicher closed 5 years ago

msiebeneicher commented 5 years ago

Describe the bug Application env vars missing in configManagementPlugins. Also the setting will not displayed in the UI.

To Reproduce I used a similar setup like here described: https://github.com/argoproj/argo-cd/blob/master/docs/user-guide/config-management-plugins.md

Test configuration plugin:

kubectl edit configmaps argocd-cm

configManagementPlugins: |
    - name: gateway-manifest-download
      init:
        command:  [ sh, -c ]
        args: [ "env > /tmp/env_command.txt" ]
      generate:
        command: [sh, -c]
        args: [ "env > /tmp/env_generate.txt" ]

Manually added env var settings to app by kubectl edit applications.argoproj.io my-app

Spec:
  Destination:
    Namespace:  ns
    Server:     https://foo.bar
  Project:      default
  Source:
    Path:  /
    Plugin:
      Env:
        Name:        FOO
        Value:        bar
      Name:           my-plugin

Expected behavior Created files should contain the setted env vars from application.

Screenshots If applicable, add screenshots to help explain your problem. image

Version

argocd: v1.0.2+e0bd546.dirty
  BuildDate: 2019-06-14T17:13:49Z
  GitCommit: e0bd546a07818ec06a27c2b3033454e3eb1c4152
  GitTreeState: dirty
  GoVersion: go1.11.4
  Compiler: gc
  Platform: linux/amd64
alexec commented 5 years ago

This is only available in v1.2.

msiebeneicher commented 5 years ago

This is only available in v1.2.

Ok - Is there any kind of workaround until the v1.2.0 will come out?

alexec commented 5 years ago

Your tool could read some file from the repo maybe? Or use the ARGOCD_APP_NAMESPACE to look up the variables?