Advertisement
Advanced ArgoCD, Sync Waves & Hooks

How do you run post-deployment smoke tests and fail the sync if they fail?

Short answer

Add a PostSync hook Job that runs the tests; if the Job fails, the sync is marked failed, signaling a bad deployment (and triggering SyncFail hooks/notifications).

Save ArgoCD mock interview
Advertisement
AModel answer
Add a PostSync hook Job that runs the tests; if the Job fails, the sync is marked failed, signaling a bad deployment (and triggering SyncFail hooks/notifications). Combined with automated rollback strategies or alerting, this gates the deployment on test success within the GitOps flow.
kind: Job
metadata:
  annotations:
    argocd.argoproj.io/hook: PostSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
Real-world example
A PostSync test Job failing marks the sync failed and pages on-call, flagging the release as broken.
Likely follow-ups
  • What signals a failed PostSync hook? | How do SyncFail hooks complement this?
Related topics