Explorar o código

libnet/ipam: remove dead DumpDatabase()

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Albin Kerouanton hai 1 ano
pai
achega
8cb7558aaf
Modificáronse 2 ficheiros con 0 adicións e 32 borrados
  1. 0 16
      libnetwork/ipam/address_space.go
  2. 0 16
      libnetwork/ipam/allocator.go

+ 0 - 16
libnetwork/ipam/address_space.go

@@ -5,7 +5,6 @@ import (
 	"fmt"
 	"net"
 	"net/netip"
-	"strings"
 	"sync"
 
 	"github.com/containerd/log"
@@ -236,18 +235,3 @@ func (aSpace *addrSpace) releaseAddress(nw, sub netip.Prefix, address netip.Addr
 
 	return p.addrs.Unset(netiputil.HostID(address, uint(nw.Bits())))
 }
-
-func (aSpace *addrSpace) DumpDatabase() string {
-	aSpace.mu.Lock()
-	defer aSpace.mu.Unlock()
-
-	var b strings.Builder
-	for k, config := range aSpace.subnets {
-		fmt.Fprintf(&b, "%v: %v\n", k, config)
-		fmt.Fprintf(&b, "  Bitmap: %v\n", config.addrs)
-		for k := range config.children {
-			fmt.Fprintf(&b, "  - Subpool: %v\n", k)
-		}
-	}
-	return b.String()
-}

+ 0 - 16
libnetwork/ipam/allocator.go

@@ -5,7 +5,6 @@ import (
 	"fmt"
 	"net"
 	"net/netip"
-	"strings"
 
 	"github.com/containerd/log"
 	"github.com/docker/docker/libnetwork/bitmap"
@@ -248,21 +247,6 @@ func getAddress(base netip.Prefix, bitmask *bitmap.Bitmap, prefAddress netip.Add
 	}
 }
 
-// DumpDatabase dumps the internal info
-func (a *Allocator) DumpDatabase() string {
-	aspaces := map[string]*addrSpace{
-		localAddressSpace:  a.local,
-		globalAddressSpace: a.global,
-	}
-
-	var b strings.Builder
-	for _, as := range []string{localAddressSpace, globalAddressSpace} {
-		fmt.Fprintf(&b, "\n### %s\n", as)
-		b.WriteString(aspaces[as].DumpDatabase())
-	}
-	return b.String()
-}
-
 // IsBuiltIn returns true for builtin drivers
 func (a *Allocator) IsBuiltIn() bool {
 	return true