Skip to content

Commit baffba1

Browse files
committed
fix aws loadbalancer vpc cidr calculation
1 parent 98f250f commit baffba1

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)