Update agent script logic
The agent container runs a script with the following flow:1
Honor dashboard on/off toggle / pin / approvals
2
Read current image_tag from ConfigMap dag-release
3
List available tags from the Hilt release ECR + release channel
4
Filter tags by UPDATE_POLICY (or converge to a pin)
5
No eligible update?
Exit 0 (nothing to do). Optional workload drift reconcile only.
6
Line change (new MAJOR.MINOR)?
Yes → pull
dag-delivery-bundle:<NEW_TAG> (infra + schema snapshot),
reconcile infra/migrations when enabled (approval-gated). Held approvals
skip the image roll. Patches (same line) skip this step — images only.7
Verify the candidate tag exists in ALL 6 repositories
Ensures Hilt published a complete release, not a partial push.
8
Mirror images
9
Update ECS task definitions
10
Force ECS redeployments
11
Restart EKS deployments
12
Wait for stability
13
Health check
14
Update ConfigMap with the new tag
15
Send webhook notification
POST $WEBHOOK_URL with JSON payload:16
On failure after mirroring
- Send failure webhook.
- Do not update the ConfigMap (next run will retry).
- Exit 1 (CronJob records failure in Kubernetes events).
Rollback
If an update causes issues, operators can manually revert:auto_update_enabled = false or auto_update_dry_run = true in terraform.tfvars and re-apply.