ipv6: Tolerate multiple routes to the same NAT Gateway

This commit is contained in:
John Gardiner Myers 2022-10-26 20:05:44 -07:00
parent c05bf4fdef
commit 49115bcc11
1 changed files with 3 additions and 1 deletions

View File

@ -211,9 +211,11 @@ func findNatGatewayFromRouteTable(cloud awsup.AWSCloud, routeTable *RouteTable)
if rt != nil { if rt != nil {
var natGatewayIDs []*string var natGatewayIDs []*string
natGatewayIDsSeen := map[string]bool{}
for _, route := range rt.Routes { for _, route := range rt.Routes {
if route.NatGatewayId != nil { if route.NatGatewayId != nil && !natGatewayIDsSeen[*route.NatGatewayId] {
natGatewayIDs = append(natGatewayIDs, route.NatGatewayId) natGatewayIDs = append(natGatewayIDs, route.NatGatewayId)
natGatewayIDsSeen[*route.NatGatewayId] = true
} }
} }