Don't delete NatGateways if there were none found

Because an empty filter means "list all NatGateways".

Thanks to @tsupertramp for finding.

Fix #1428
This commit is contained in:
Justin Santa Barbara 2017-01-10 18:30:15 -05:00
parent 37bcafea04
commit cd3cff8b5b
1 changed files with 1 additions and 1 deletions

View File

@ -1468,7 +1468,7 @@ func FindNatGateways(cloud fi.Cloud, routeTableIds sets.String) ([]*ResourceTrac
var trackers []*ResourceTracker
{
if len(natGatewayIds) != 0 {
request := &ec2.DescribeNatGatewaysInput{}
for natGatewayId := range natGatewayIds {
request.NatGatewayIds = append(request.NatGatewayIds, aws.String(natGatewayId))