Compare snapshots
See exactly what changed between two snapshots, and what differs between a snapshot and the live cluster, before and after you promote or restore.
A snapshot is the exact set of objects Wardn rendered for a deployment from one commit, so comparing two of them answers "what will change on the cluster?" without reading a git diff or re-running a render. This page covers the three comparisons Wardn offers: snapshot against snapshot, the running snapshot against the cluster, and what a promotion or a restore would change. The model is in Snapshots.
You need deployment:read on the deployment. Comparing changes nothing.
Pick the comparison
| You want to know | Use | Where |
|---|---|---|
| What changed in this snapshot compared with the one before | Vs previous | A snapshot's page, Compare with |
| How this snapshot differs from what runs now | Vs running | A snapshot's page, Compare with |
| What the cluster holds that the running snapshot does not say | Live diff | The deployment's Live diff tab |
| What the next snapshot would change before you promote it | Next snapshot | Live diff, Compare live with |
| What a restore would change | What changes | The restore dialog; see Restore and rollback |
Snapshot against snapshot
Open a deployment, then Snapshots, and choose a snapshot. The header shows what it is (the commit, the branch, who pushed, whether it is running, and the lineage when it was promoted, such as dev → staging → QA). Its sections show what changed:
- What changed lists the apps in the snapshot. For each app: its version (the commit), what kinds of change it carries (Image, Values, Config, Secrets), and the number of commits. Unchanged apps are listed too, so the snapshot is complete.
- Compare with switches between Vs previous and Vs running and shows the objects that were Added, Removed or Changed, as a diff per object.
- Settings and secrets lists the settings each app ran with. A secret appears as a fingerprint; its value is never stored.
- Jobs shows the jobs that ran around the apply.
- Commits lists the commits since the previous snapshot. Wardn can list them only for GitHub sources, because other git hosts cannot list the commits between two.
Reading a diff
Each changed object shows its kind and name (Deployment/web) and the fields that differ, as a code diff of the object's YAML. Choose Split or Unified for the layout, Hide unchanged to fold the lines that match, and All apps or one app to filter. A heading shows how many objects were added, removed and changed.
| Mark | Meaning |
|---|---|
| Added | The object is in the second snapshot and not the first. |
| Removed | It was in the first and is gone from the second. Applying it prunes the object, within the deployment's prune limit. |
| Changed | The object is in both and some fields differ. |
A Secret is never shown. Wardn compares secrets by fingerprint, so you see that a secret changed, not its value.
The running snapshot against the cluster
The Live diff tab compares what the deployment runs with what the cluster holds. The operator checks after each apply and on a schedule, and the banner says when: "Live matches 9f8e7d6. Checked 2m ago against the running snapshot", or "1 object differs from 9f8e7d6". It is the same data as drift, shown as a diff. An object that is missing from the cluster is shown as added.
Compare live with changes the snapshot side:
- Running snapshot: the default. Differences here are drift.
- Next snapshot: the newest rendered snapshot that is newer than the one running and not held or discarded. This is "what would change on the cluster if I applied it now". It shows Nothing newer to compare when none is waiting.
- Any other snapshot you pick from the list.
If the operator has not reported, the tab says Not checked yet.
Before you promote or restore
- On a snapshot's page, Promote opens a preflight that lists, app by app, how the snapshot differs from what the target deployment runs, and how it fares against each rule. See Held snapshots and Guardrails.
- In the restore dialog, What changes shows how many apps would change and the kinds of change, and Before you restore lists the checks. See Restore and rollback.
With the API
api() { curl -fsS -H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' "$@"; }
# Snapshot against snapshot. from defaults to the running snapshot, to to the wanted one.
api "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT_ID/diff?from=$FROM_SNAPSHOT&to=$TO_SNAPSHOT"
api "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT_ID/diff?appId=$APP_ID" # one app
# The running snapshot against the cluster
api "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT_ID/live-diff"Both answers have counts (added, removed, changed), apps (the same counts per app, over every page) and items, a page of resources. Each resource names its group, version, kind, namespace and name, a change, and fields: a JSON pointer path with the value from and the value to. before and after hold the whole object as JSON, empty for a missing side and for a Secret. In a live diff from is the live value and to is the snapshot's. Both calls page with limit and cursor, and both snapshots must belong to the deployment.