Summary
When argocd app diff finds no differences between live and target state,
the command exits silently with code 0. This is confusing to users who cannot
tell if the command worked correctly or failed silently.
Motivation
Running argocd app diff guestbook on a synced application produces:
A user unfamiliar with the tool has no way to distinguish this from a silent
failure. Other similar tools handle this explicitly:
helm diff prints "No changes"
kubectl diff prints a clear message when there is nothing to show
Proposal
Print an informational message to stderr when no differences are found:
Application 'guestbook' has no differences from the live state.
Printing to stderr ensures scripts capturing stdout diff output are not
affected. The change is in cmd/argocd/commands/app_diff.go around line 784
where foundDiffs is evaluated.
Implementation
Add after the foundDiffs check:
if !foundDiffs {
fmt.Fprintf(os.Stderr, "Application '%s' has no differences from the live state.\n", appName)
}
Summary
When
argocd app difffinds no differences between live and target state,the command exits silently with code 0. This is confusing to users who cannot
tell if the command worked correctly or failed silently.
Motivation
Running
argocd app diff guestbookon a synced application produces:A user unfamiliar with the tool has no way to distinguish this from a silent
failure. Other similar tools handle this explicitly:
helm diffprints "No changes"kubectl diffprints a clear message when there is nothing to showProposal
Print an informational message to stderr when no differences are found:
Application 'guestbook' has no differences from the live state.
Printing to stderr ensures scripts capturing stdout diff output are not
affected. The change is in
cmd/argocd/commands/app_diff.goaround line 784where
foundDiffsis evaluated.Implementation
Add after the
foundDiffscheck:if !foundDiffs {
fmt.Fprintf(os.Stderr, "Application '%s' has no differences from the live state.\n", appName)
}