Wait for Namespace runner terminal state
This commit is contained in:
parent
de32d8390e
commit
4d7c19e593
3 changed files with 44 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue