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:
joshsiv-mulga
2026-05-11 15:35:37 +10:00
parent d66f9e9424
commit e0f36c933d
+8 -3
View File
@@ -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 {