mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-23 04:36:40 +00:00
fix(ddil): case-insensitive transient SSH error match
awaitGuestSSH's retry matcher used lowercase substrings, but x/crypto/ssh emits "ssh: rejected: connect failed (Connection refused)" with capital C — strings.Contains returned false and the helper bailed on first attempt instead of polling. Last run failed in 49s, not the 90s budget. Lowercase the error before matching, and add "connect failed" as the canonical signal for "jump host dial through tunnel failed". Continues mulga-siv-57.
This commit is contained in:
@@ -496,10 +496,15 @@ func awaitGuestSSH(ctx context.Context, w *Witness, host Node, publicIP string,
|
||||
return nil
|
||||
}
|
||||
lastErr = err
|
||||
msg := err.Error()
|
||||
transient := strings.Contains(msg, "connection refused") ||
|
||||
msg := strings.ToLower(err.Error())
|
||||
// "connect failed" covers x/crypto/ssh's
|
||||
// `ssh: rejected: connect failed (Connection refused)`
|
||||
// which fires when the SSH jump host's DialContext fails — the
|
||||
// canonical signal that the guest hasn't bound :22 yet.
|
||||
transient := strings.Contains(msg, "connect failed") ||
|
||||
strings.Contains(msg, "connection refused") ||
|
||||
strings.Contains(msg, "connection reset") ||
|
||||
strings.Contains(msg, "EOF") ||
|
||||
strings.Contains(msg, "eof") ||
|
||||
strings.Contains(msg, "i/o timeout") ||
|
||||
strings.Contains(msg, "no route to host")
|
||||
if !transient {
|
||||
|
||||
Reference in New Issue
Block a user