Skip to content

Commit

Permalink
aws: Ignore InvalidRouteTableID.NotFound errors during cluster deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
hakman committed Jan 14, 2024
1 parent 8769a84 commit d4f152d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/resources/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ func ListSubnets(cloud fi.Cloud, vpcID, clusterName string) ([]*resources.Resour

rtRequest := &ec2.DescribeRouteTablesInput{}
rtResponse, err := c.EC2().DescribeRouteTables(rtRequest)
if err != nil {
if err != nil && awsup.AWSErrorCode(err) != "InvalidRouteTableID.NotFound" {
return nil, fmt.Errorf("error describing RouteTables: %v", err)
}
// sharedNgwIds is the set of IDs for shared NGWs, that we should not delete
Expand Down Expand Up @@ -1305,7 +1305,7 @@ func FindNatGateways(cloud fi.Cloud, routeTables map[string]*resources.Resource,
request.RouteTableIds = append(request.RouteTableIds, aws.String(routeTable.ID))
}
response, err := c.EC2().DescribeRouteTables(request)
if err != nil {
if err != nil && awsup.AWSErrorCode(err) != "InvalidRouteTableID.NotFound" {
return nil, fmt.Errorf("error from DescribeRouteTables: %v", err)
}
for _, rt := range response.RouteTables {
Expand Down

0 comments on commit d4f152d

Please sign in to comment.