1
0
Fork 0

fix: translate configured server port into correct mapped host port

This commit is contained in:
Alessandro Chitolina 2020-11-09 17:12:05 +01:00 committed by GitHub
parent 9bdf9e1e02
commit 920e82f11a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 134 additions and 8 deletions

View file

@ -307,6 +307,13 @@ func (p Provider) getIPAddress(instance ecsInstance) string {
func getPort(instance ecsInstance, serverPort string) string {
if len(serverPort) > 0 {
for _, port := range instance.machine.ports {
containerPort := strconv.FormatInt(port.containerPort, 10)
if serverPort == containerPort {
return strconv.FormatInt(port.hostPort, 10)
}
}
return serverPort
}