libnetwork/ipams/defaultipam/allocator.go
Method Allocator.RequestPool
has 11 return statements (exceeds 4 allowed). Open
Open
func (a *Allocator) RequestPool(req ipamapi.PoolRequest) (ipamapi.AllocatedPool, error) {
log.G(context.TODO()).Debugf("RequestPool: %+v", req)
parseErr := func(err error) error {
return types.InternalErrorf("failed to parse pool request for address space %q pool %q subpool %q: %v", req.AddressSpace, req.Pool, req.SubPool, err)
Function NewAllocator
has 7 return statements (exceeds 4 allowed). Open
Open
func NewAllocator(lcAs, glAs []*ipamutils.NetworkToSplit) (*Allocator, error) {
var (
a Allocator
err error
lcAs4, lcAs6, glAs4, glAs6 []*ipamutils.NetworkToSplit
Function getAddress
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func getAddress(base netip.Prefix, bitmask *bitmap.Bitmap, prefAddress netip.Addr, ipr netip.Prefix, serial bool) (netip.Addr, error) {
Method Allocator.getAddrSpace
has 5 return statements (exceeds 4 allowed). Open
Open
func (a *Allocator) getAddrSpace(as string, v6 bool) (*addrSpace, error) {
switch as {
case localAddressSpace:
if v6 {
return a.local6, nil
Method Allocator.RequestAddress
has 5 return statements (exceeds 4 allowed). Open
Open
func (a *Allocator) RequestAddress(poolID string, prefAddress net.IP, opts map[string]string) (*net.IPNet, map[string]string, error) {
log.G(context.TODO()).Debugf("RequestAddress(%s, %v, %v)", poolID, prefAddress, opts)
k, err := PoolIDFromString(poolID)
if err != nil {
return nil, nil, types.InvalidParameterErrorf("invalid pool id: %s", poolID)