mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
rename machines to connections in config
This commit is contained in:
@@ -3,8 +3,8 @@ package config
|
||||
import "uncloud/internal/secret"
|
||||
|
||||
type Cluster struct {
|
||||
Name string `toml:"-"`
|
||||
Machines []MachineConnection `toml:"machines"`
|
||||
Name string `toml:"-"`
|
||||
Connections []MachineConnection `toml:"connections"`
|
||||
// UserPrivateKey is the user's WireGuard private key used to connect to cluster machines.
|
||||
UserPrivateKey secret.Secret `toml:"user_private_key"`
|
||||
}
|
||||
|
||||
@@ -33,8 +33,9 @@ func NewSSHDestination(user, host string, port int) SSHDestination {
|
||||
}
|
||||
|
||||
func (d SSHDestination) Parse() (user string, host string, port int, err error) {
|
||||
if strings.Contains(string(d), "@") {
|
||||
user, host, _ = strings.Cut(string(d), "@")
|
||||
host = string(d)
|
||||
if strings.Contains(host, "@") {
|
||||
user, host, _ = strings.Cut(host, "@")
|
||||
}
|
||||
h, p, sErr := net.SplitHostPort(host)
|
||||
if sErr == nil {
|
||||
|
||||
Reference in New Issue
Block a user