Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo server overrides side car plugin environment variables #9393

Closed
3 tasks done
pierrecregut opened this issue May 13, 2022 · 0 comments
Closed
3 tasks done

Repo server overrides side car plugin environment variables #9393

pierrecregut opened this issue May 13, 2022 · 0 comments
Labels
bug Something isn't working component:cmp Config Management Plugin related issues

Comments

@pierrecregut
Copy link
Contributor

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

Sidecar CMP plugins are run with an environment inherited from the repo server container concatenated to their own environment. The inherited environment contains not only the variables declared in the application but also the regular environment of the repo server (for example PATH).

To Reproduce

A deployment of argocd with a sidecar plugin configured as in the documentation. We assume the side car plugin can print its environment somewhere as a debug output during generate phase is needed.
Patch the repo-server deployment to add a variable (eg. TEST) with value repo-server in argocd-repo-server container and cmp-server in the cmp container.

Expected behavior
After reconciliation, check the value of the saved TEST variable, it is repo-server and not cmp-server.

Version
Also occurs on current master branch

argocd-server: v2.3.3+07ac038
  BuildDate: 2022-03-30T00:06:18Z
  GitCommit: 07ac038a8f97a93b401e824550f0505400a8c84e
  GitTreeState: clean
  GoVersion: go1.17.6
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: v4.4.1 2021-11-11T23:36:27Z
  Helm Version: v3.8.0+gd141386
  Kubectl Version: v0.23.1
@pierrecregut pierrecregut added the bug Something isn't working label May 13, 2022
pierrecregut added a commit to pierrecregut/argo-cd that referenced this issue May 13, 2022
getPluginEnvs is both used for local plugins and sidecar plugins. For the later
do not include the environement variables of the repo-server in the supplied
variables.

Fixes: argoproj#9393
Signed-off-by: Pierre Crégut <[email protected]>
@crenshaw-dev crenshaw-dev added the component:cmp Config Management Plugin related issues label May 25, 2022
crenshaw-dev pushed a commit that referenced this issue Jun 2, 2022
…9319)

* fix: do not export repo-server environment to sidecar (#9393)

getPluginEnvs is both used for local plugins and sidecar plugins. For the later
do not include the environement variables of the repo-server in the supplied
variables.

Fixes: #9393
Signed-off-by: Pierre Crégut <[email protected]>

* feat: Add plugin call variables to sidecar plugin discovery (#9273)

Gives access to variables declared in the call of the plugin in the application
manifest to the discover command run on the CMP server.

Variables are prefixed with ARGOCD_ENV_ to avoid security issues (plugin call
overiding important variables).

Fixes #9273

Signed-off-by: Pierre Crégut <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:cmp Config Management Plugin related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants