feat(region): allow custom sshport when make sshable

This commit is contained in:
rainzm
2021-09-01 11:42:28 +08:00
parent 66495788df
commit 9103e4fba5
8 changed files with 79 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,