From a54fee5f3bd44dd354dfd06cf1710bfd8609a60f Mon Sep 17 00:00:00 2001 From: Xue Li Date: Thu, 18 Apr 2024 13:51:45 +0800 Subject: [PATCH] OCM-7480 | test: fix vpc client preparation will stuck to vpc creation --- pkg/test/vpc_client/cidr.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/test/vpc_client/cidr.go b/pkg/test/vpc_client/cidr.go index 9cfa4a5..9b4af40 100644 --- a/pkg/test/vpc_client/cidr.go +++ b/pkg/test/vpc_client/cidr.go @@ -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, @@ -36,6 +35,7 @@ func (v *VPCCIDRPool) GenerateSubnetPool(prefix int) { } else { break } + currentSubnet, finished = cidr.NextSubnet(currentSubnet, prefix) } v.SubNetPool = subnetcidrs }