Merge pull request #7525 from dzoeteman/elastic-ip-shared

Don't try to delete ElasticIPs of NatGateway is shared
This commit is contained in:
Kubernetes Prow Robot 2019-09-06 08:50:58 -07:00 committed by GitHub
commit 32b6adc1e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -1339,7 +1339,13 @@ func FindNatGateways(cloud fi.Cloud, routeTables map[string]*resources.Resource,
natGatewayId := aws.StringValue(ngw.NatGatewayId)
forceShared := !ownedNatGatewayIds.Has(natGatewayId)
resourceTrackers = append(resourceTrackers, buildNatGatewayResource(ngw, forceShared, clusterName))
ngwResource := buildNatGatewayResource(ngw, forceShared, clusterName)
resourceTrackers = append(resourceTrackers, ngwResource)
// Dont try to remove ElasticIPs if NatGateway is shared
if ngwResource.Shared {
continue
}
// If we're deleting the NatGateway, we should delete the ElasticIP also
for _, address := range ngw.NatGatewayAddresses {