Skip to content

Commit c232e4f

Browse files
authored
Merge pull request kubernetes#92227 from M00nF1sh/nlb_vpc_cidr
fix aws loadbalancer vpc cidr calculation
2 parents c2c6e75 + baffba1 commit c232e4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

staging/src/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,9 @@ func (c *Cloud) getVpcCidrBlocks() ([]string, error) {
721721

722722
cidrBlocks := make([]string, 0, len(vpcs.Vpcs[0].CidrBlockAssociationSet))
723723
for _, cidr := range vpcs.Vpcs[0].CidrBlockAssociationSet {
724+
if aws.StringValue(cidr.CidrBlockState.State) != ec2.VpcCidrBlockStateCodeAssociated {
725+
continue
726+
}
724727
cidrBlocks = append(cidrBlocks, aws.StringValue(cidr.CidrBlock))
725728
}
726729
return cidrBlocks, nil

0 commit comments

Comments
 (0)