CICD-298 · GitOps drift detection
Encyclopedia · Advanced GitOps and progressive delivery · All snippets
Previous · CICD-297 · Next · CICD-299
1. Where it fits
- Placement CI run step or authorized lab terminal.
- Prerequisites trusted configuration repository, test cluster and named GitOps controller or rollout controller.
- Platforms kubernetes, local-lab.
- Parameters
ARGO_APP.
2. Copy the snippet
bash
argocd app get "${ARGO_APP:?}" --refresh -o json | jq -e '.status.sync.status == "Synced" and .status.health.status == "Healthy"'3. How it works
The client queries the controller's Application record for desired revision, health and synchronization state. The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.
4. Verify the result
Inspect refresh permissions and expected Git revision. OutOfSync and Degraded indicate different failure classes.
Validation syntax-validated (Bash parse). Status definitions.