Skip to content

Commit

Permalink
libnet/ipam: remove dead DumpDatabase()
Browse files Browse the repository at this point in the history
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
  • Loading branch information
akerouanton committed Apr 26, 2024
1 parent df88857 commit 199c72c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
16 changes: 0 additions & 16 deletions libnetwork/ipam/address_space.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"net"
"net/netip"
"strings"
"sync"

"github.com/containerd/log"
Expand Down Expand Up @@ -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()
}
16 changes: 0 additions & 16 deletions libnetwork/ipam/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"net"
"net/netip"
"strings"

"github.com/containerd/log"
"github.com/docker/docker/libnetwork/bitmap"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 199c72c

Please sign in to comment.