argoproj / argo-cd

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

Resource Diff Based on Application Spec Changes #20910

Open wmiller112 opened 6 days ago

wmiller112 commented 6 days ago

Summary

Currently, the app diff command allows you to see the changes that would occur for the resources managed by an app compared to a proposed version (either local or in VCS) of its source, but there does not seem to be any way to compare the impact on managed resources that would result from changing the app spec itself.

For example, if you wanted to move the directory to which an app's source.path points, and simultaneously update the source.path to point to that new location. Running an app diff would result in app path does not exist because it's using the spec of the live app to point to the proposed source (or locally provided manifests). Similarly, adding/modifying a plugin.env (or really anything else) to an application, the resulting diff does not allow seeing the impact that would have on owned resources.

It seems like maybe app sync would handle this with --dry-run and --preview-changes but I haven't gotten any successful output with this combination.

Motivation

Ability to show a more complete impact of proposed changes before merging. In my case I'm using the underlying argocd cli functionality to generate the apps from any impacted appset changes, and if there is a diff on any of those apps, the only thing I can do is print that diff of the application. It would nice to be able to continue to generate the owned resource diff with the updated app spec.

Proposal

It's possible I'm missing something with app sync. If not, I would think maybe an option in app diff to use the app spec from the provided manifests, whether those be coming from a --revision or --local