Skip to content

Commit

Permalink
libnet: move ipam pkg to ipam/defaultipam
Browse files Browse the repository at this point in the history
All drivers except the default ipam driver are stored in ipams/.
Since `default` isn't a valid Go pkg name, this package is
renamed to `defaultipam`, following `windowsipam` example.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
  • Loading branch information
akerouanton committed Apr 26, 2024
1 parent e8644c3 commit 29f2ca0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libnetwork/ipams/builtin/builtin.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package builtin

import (
"github.com/docker/docker/libnetwork/ipam"
"github.com/docker/docker/libnetwork/ipamapi"
"github.com/docker/docker/libnetwork/ipams/defaultipam"
"github.com/docker/docker/libnetwork/ipamutils"
)

Expand All @@ -19,7 +19,7 @@ func registerBuiltin(ic ipamapi.Registerer, addressPools []*ipamutils.NetworkToS
}
}

a, err := ipam.NewAllocator(localAddressPools, ipamutils.GetGlobalScopeDefaultNetworks())
a, err := defaultipam.NewAllocator(localAddressPools, ipamutils.GetGlobalScopeDefaultNetworks())
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ipam
package defaultipam

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ipam
package defaultipam

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ipam
package defaultipam

import (
"context"
Expand Down Expand Up @@ -357,7 +357,7 @@ func TestPoolAllocationReuse(t *testing.T) {
// Verify that we don't see any repeat networks even though
// we have freed them.
seen := map[string]bool{}
for i := 0; i < len(allocs); i++ {
for range allocs {
alloc, err := a.RequestPool(ipamapi.PoolRequest{AddressSpace: localAddressSpace})
if err != nil {
t.Fatal(err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ipam
package defaultipam

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ipam
package defaultipam

import (
"fmt"
Expand Down

0 comments on commit 29f2ca0

Please sign in to comment.