feat(region): allow custom sshport when make sshable

This commit is contained in:
rainzm
2021-09-01 11:49:16 +08:00
parent 73bc984bcc
commit b56e56bcbf
7 changed files with 77 additions and 6 deletions
+6 -1
View File
@@ -16,6 +16,7 @@ package models
import (
"context"
"strconv"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
@@ -101,10 +102,14 @@ func (man *SProxyEndpointManager) PerformCreateFromServer(ctx context.Context, u
return nil, httperrors.NewGeneralError(err)
}
port := 22
if portStr, ok := serverInfo.Server.Metadata[compute_apis.SSH_PORT]; ok {
port, _ = strconv.Atoi(portStr)
}
proxyendpoint := &SProxyEndpoint{
User: "cloudroot",
Host: host,
Port: 22,
Port: port,
PrivateKey: serverInfo.PrivateKey,
IntranetIpAddr: nic.IpAddr,