Skip to content

Commit

Permalink
OCM-7480 | test: fix vpc client preparation will stuck to vpc creation
Browse files Browse the repository at this point in the history
  • Loading branch information
xueli181114 committed Apr 18, 2024
1 parent 0cac2b2 commit a54fee5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/test/vpc_client/cidr.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ func NewCIDRPool(vpcCIDR string) *VPCCIDRPool {
func (v *VPCCIDRPool) GenerateSubnetPool(prefix int) {
subnetcidrs := []*SubnetCIDR{}
_, vpcSubnet, _ := net.ParseCIDR(v.CIDR)
currentSubnet, _ := cidr.PreviousSubnet(vpcSubnet, prefix)
currentSubnet, finished := cidr.PreviousSubnet(vpcSubnet, prefix)
for {
currentSubnet, finished := cidr.NextSubnet(currentSubnet, prefix)
if !finished && vpcSubnet.Contains(currentSubnet.IP) {
subnetcidr := SubnetCIDR{
IPNet: currentSubnet,
Expand All @@ -36,6 +35,7 @@ func (v *VPCCIDRPool) GenerateSubnetPool(prefix int) {
} else {
break
}
currentSubnet, finished = cidr.NextSubnet(currentSubnet, prefix)
}
v.SubNetPool = subnetcidrs
}
Expand Down

0 comments on commit a54fee5

Please sign in to comment.