Open SamirMarin opened 1 year ago
Hi, we have a cleaning tool that scans the cluster for ImagePullBackOff pods and scales down their deployments to 0. Additionally, it adds annotations/labels to those deployments with messages like "deployment was scaled down by our tool". Logically, we expected that this would generate a diff in the manifests for developers. So, the next time they sync the app, there would be a diff, and after syncing, the added annotations/labels would be deleted. However, we've observed that there is no diff being generated. It appears that ArgoCD only detects diffs for replica count and image changes.
Currently, I assume there is no way we can customize the diff behavior until this enhancement will be added to the ArgoCD? Thank you
Summary
What change you think needs making.
Currently when adding new labels, new annotations or other non git managed fields such as new environments variables on the argocd gui, the changes are added to the live manifest but it does not cause the argo app to show out of sync (show a diff).
This behaviour is expected to avoid showing diffs when k8s operators or object mutations make changes. However it would be nice if we could see diffs whenever we make edits manually with kubeclt edit or directly on argo gui.
Motivation
Please give examples of your use case, e.g. when would you use this.
Sometimes when testing out new changes to kuberenetes resource it is convenient to make the changes directly on the argocd gui or with kubectl edit before moving them to version control, however for changes that don't show up as out sync it can be hard to keep up with the manual changes made, before moving them to git.
Proposal
How do you think this should be implemented?
Differentiate between manual changes made on the argocd gui or with kubectl edit vs those made by k8s operators, object mutation etc? This might be possible, by only considering updated fields by some manager configured globally and users could configure ignoreDifferences on their applications to negate that effect if required.
Notes
I had originally filed this as a bug, but found out it was expected behaviour. In the issue comments I had a few questions and it looks like implementing this behaviour could be possible, I was asked to reopen the issue as an enhancement but I don't have the permissions reopen the issue, so I created a new enhancement issue instead.