feat: try each cluster connection in order until one succeeds, add progress spinner

This commit is contained in:
Pasha Sviderski
2025-09-13 21:12:20 +10:00
parent e1734a1aa6
commit 831c581e0f
6 changed files with 253 additions and 50 deletions
+10
View File
@@ -1,6 +1,7 @@
package config
import (
"fmt"
"net"
"net/netip"
"strconv"
@@ -24,6 +25,15 @@ type MachineConnection struct {
PublicKey secret.Secret `yaml:"public_key,omitempty"`
}
func (c MachineConnection) String() string {
if c.SSH != "" {
return string(c.SSH)
} else if c.TCP != nil && c.TCP.IsValid() {
return fmt.Sprintf("tcp://%s", c.TCP)
}
return "unknown connection"
}
// SSHDestination represents an SSH destination string in the canonical form of "user@host:port".
// The default user "root" and port 22 can be omitted.
type SSHDestination string