Merge pull request #92227 from M00nF1sh/nlb_vpc_cidr

fix aws loadbalancer vpc cidr calculation
This commit is contained in:
Kubernetes Prow Robot 2020-06-22 15:02:25 -07:00 committed by GitHub
commit c232e4fae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -721,6 +721,9 @@ func (c *Cloud) getVpcCidrBlocks() ([]string, error) {
cidrBlocks := make([]string, 0, len(vpcs.Vpcs[0].CidrBlockAssociationSet))
for _, cidr := range vpcs.Vpcs[0].CidrBlockAssociationSet {
if aws.StringValue(cidr.CidrBlockState.State) != ec2.VpcCidrBlockStateCodeAssociated {
continue
}
cidrBlocks = append(cidrBlocks, aws.StringValue(cidr.CidrBlock))
}
return cidrBlocks, nil