Skip to content

Commit e17adb5

Browse files
committed
routing: ensure routes to eigw are up to date
In the case where egress-only-internet-gateway is deleted, CAPA reconcilation loop will create a new one. Thus, CAPA needs to modify the routes to point to the new eigw ID.
1 parent 4b48513 commit e17adb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/cloud/services/network/routetables.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ func (s *Service) fixMismatchedRouting(specRoute *ec2.CreateRouteInput, currentR
145145
if (currentRoute.DestinationIpv6CidrBlock != nil &&
146146
aws.ToString(currentRoute.DestinationIpv6CidrBlock) == aws.ToString(specRoute.DestinationIpv6CidrBlock)) &&
147147
((currentRoute.GatewayId != nil && aws.ToString(currentRoute.GatewayId) != aws.ToString(specRoute.GatewayId)) ||
148-
(currentRoute.NatGatewayId != nil && aws.ToString(currentRoute.NatGatewayId) != aws.ToString(specRoute.NatGatewayId))) {
148+
(currentRoute.NatGatewayId != nil && aws.ToString(currentRoute.NatGatewayId) != aws.ToString(specRoute.NatGatewayId)) ||
149+
(currentRoute.EgressOnlyInternetGatewayId != nil && aws.ToString(currentRoute.EgressOnlyInternetGatewayId) != aws.ToString(specRoute.EgressOnlyInternetGatewayId))) {
149150
input = &ec2.ReplaceRouteInput{
150151
RouteTableId: rt.RouteTableId,
151152
DestinationIpv6CidrBlock: specRoute.DestinationIpv6CidrBlock,

0 commit comments

Comments
 (0)