Skip to content

Commit fe5e047

Browse files
address ipfamily comment
1 parent 920d081 commit fe5e047

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cns/restserver/ipam.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -997,18 +997,12 @@ func (service *HTTPRestService) AssignAvailableIPConfigs(podInfo cns.PodInfo) ([
997997
return nil, ErrNoNCs
998998
}
999999

1000-
// Get the number of distinct IP families (IPv4/IPv6) across all NC's
1001-
numOfIPFamilies := service.GetIPFamilyCount()
1000+
// Get the number of distinct IP families (IPv4/IPv6) across all NC's and determine the number of IPs to assign based on IP families found
1001+
numberOfIPs := service.GetIPFamilyCount()
10021002

10031003
// Get the actual IP families map for validation
10041004
ncIPFamilies := service.getIPFamiliesMap()
10051005

1006-
// Determine the number of IPs to assign based on IP families found
1007-
numberOfIPs := numOfNCs
1008-
if numOfIPFamilies != 0 {
1009-
numberOfIPs = numOfIPFamilies
1010-
}
1011-
10121006
service.Lock()
10131007
defer service.Unlock()
10141008
// Creates a slice of PodIpInfo with the size as number of NCs to hold the result for assigned IP configs

0 commit comments

Comments
 (0)