1
0
Fork 0

Add support for ECS Anywhere

This commit is contained in:
José Gaspar 2022-09-14 15:22:08 +01:00 committed by GitHub
parent fd95560c66
commit b351266b2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 138 additions and 11 deletions

View file

@ -292,7 +292,7 @@ func (p *Provider) addServer(instance ecsInstance, loadBalancer *dynamic.Servers
func (p *Provider) getIPPort(instance ecsInstance, serverPort string) (string, string, error) {
var ip, port string
ip = p.getIPAddress(instance)
ip = instance.machine.privateIP
port = getPort(instance, serverPort)
if len(ip) == 0 {
return "", "", fmt.Errorf("unable to find the IP address for the instance %q: the server is ignored", instance.Name)
@ -301,10 +301,6 @@ func (p *Provider) getIPPort(instance ecsInstance, serverPort string) (string, s
return ip, port, nil
}
func (p Provider) getIPAddress(instance ecsInstance) string {
return instance.machine.privateIP
}
func getPort(instance ecsInstance, serverPort string) string {
if len(serverPort) > 0 {
for _, port := range instance.machine.ports {