Wait for Namespace runner terminal state
Some checks failed
Cache: Publish Nix / Publish Nix Cache (push) Failing after 22s
Build Rust / Cargo Test (push) Successful in 5m47s
Build Site / Next.js Build (push) Failing after 4s
Lint Governance / BEP Metadata (push) Successful in 1s

This commit is contained in:
Conrad Kramer 2026-06-07 08:57:28 -07:00
parent de32d8390e
commit 4d7c19e593
3 changed files with 44 additions and 2 deletions

View file

@ -284,22 +284,28 @@ func instanceStopped(output string) bool {
if len(payload) == 0 {
return false
}
seenTerminalState := false
for _, entry := range payload {
if len(entry.PerResource) == 0 {
return false
}
for _, target := range entry.PerResource {
if target.Tombstone != "" {
seenTerminalState = true
return true
}
if len(target.Container) == 0 {
continue
return false
}
for _, container := range target.Container {
if container.Status != "stopped" && container.TerminatedAt == "" {
return false
}
seenTerminalState = true
}
}
}
return true
return seenTerminalState
}
func (d *Dispatcher) waitForInstanceStop(ctx context.Context, runnerName, instanceID string, timeout time.Duration) bool {