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

"ghost" env var #19548

Closed
Shani-Cohen opened this issue Aug 15, 2024 · 3 comments
Closed

"ghost" env var #19548

Shani-Cohen opened this issue Aug 15, 2024 · 3 comments
Labels
bug Something isn't working component:sync

Comments

@Shani-Cohen
Copy link

Describe the bug

Whenever adding an environment variable manually through the UI and the variable does not exist in your config - argo does not recognize it as out of sync and it keeps the variable even after syncing the app or deploying new images, etc.
this can cause weird behaviors that are "invisible" and really hard to investigate.

To Reproduce

  • add a new env var through the UI that does not exist in the config.
  • sync the app
  • see that the new pods raise with the same env var.

Expected behavior

adding a new env var should be recognized as out of sync. whenever we sync the app the var should disappear.

Version

v2.10.5+335875d

@Shani-Cohen Shani-Cohen added the bug Something isn't working label Aug 15, 2024
@ChristianCiach
Copy link
Contributor

ChristianCiach commented Aug 15, 2024

I believe you have a little misunderstanding about how ArgoCD syncs work, or actually kubectl apply in general.

ArgoCD (and kubectl apply) performs a "three-way merge patch" to diff and apply resources. When performing this type of merge, ArgoCD only compares (and applies) the attributes that are defined inside the original manifests (inside your git repo). As a consequence, you could also scale your Deployments by patching the .spec.replicas attribute of your Deployment inside the cluster and ArgoCD wouldn't complain at all (as long as your versioned manifest does not declare this attribute).

My point is: This is expected behavior. Also, this issue seems to be a duplicate of #4537 where you can read more about this behavior.

@Shani-Cohen
Copy link
Author

Hi, thank you for the quick answer.
after reading all the comments in the previous issue (#4537) I guess my only question is-
it seems like this behavior is unexpected and not trivial to a lot of people that encountered the same problem. is there an option to rethink this? maybe have the env vars appear somewhere or marked somehow?

@blakepettersson
Copy link
Member

Duplicates #4537 - please direct any queries/comments to that issue instead.

@blakepettersson blakepettersson closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2024
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:sync
Projects
None yet
Development

No branches or pull requests

4 participants