ArgoCD › Sync Waves & Hooks
How do you run post-deployment smoke tests and fail the sync if they fail?
AdvancedAnswer
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: HookSucceededReal-world example A PostSync test Job failing marks the sync failed and pages on-call, flagging the release as broken.