feat(atlas): Phase C — live CD/deploy state on stage 07
CD / Lint / Test / Vet (push) Successful in 4s
CD / Build & Import (push) Successful in 13s
CD / Detect unsubstituted template (push) Successful in 0s
CD / Deploy via GitOps (push) Has been skipped

Stage 07 now shows the pod's own live deploy state — deployed image tag +
N/M replicas ready, green only when the rollout is fully ready — read from the
k8s Deployment in-cluster (new namespaced deployments-read Role). DeployState/
DeployNode test-first; prepended to the authored CD narrative, fallback-safe.

Verified: build/vet/lint(0)/test green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-20 07:39:01 +02:00
co-authored by Claude Opus 4.8
parent 3ff922a4d5
commit 3d1f76997b
5 changed files with 115 additions and 4 deletions
+17 -3
View File
@@ -55,6 +55,14 @@ func NewHandler() http.Handler {
}
}
}
if ld.deploy != nil {
node := atlas.DeployNode(*ld.deploy)
for i := range a.Stages {
if a.Stages[i].Generate == "deploy-state" {
a.Stages[i].Nodes = append([]atlas.Node{node}, a.Stages[i].Nodes...)
}
}
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
_ = json.NewEncoder(w).Encode(a)
})
@@ -63,9 +71,10 @@ func NewHandler() http.Handler {
// liveOverlay holds cluster-sourced substrate facts (node specs + namespace line).
type liveOverlayData struct {
hosts []atlas.Host
ns string
run *atlas.RunSummary
hosts []atlas.Host
ns string
run *atlas.RunSummary
deploy *atlas.Deploy
}
// live cache: query the cluster at most once per TTL; fall back to the authored
@@ -102,6 +111,11 @@ func liveOverlay() liveOverlayData {
d.run = &r
}
}
if raw, err := cluster.Deployment(); err == nil {
if dep, err := atlas.DeployState(raw); err == nil {
d.deploy = &dep
}
}
liveCache = d
return d
}