Skip to content

feat: print informational message when argocd app diff finds no differences #27705

@Rishmish94

Description

@Rishmish94

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:

  • No output
  • Exit code 0

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriage/pendingThis issue needs further triage to be correctly classified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions