mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat(region): allow custom sshport when make sshable
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user