From 716af1c1ee5549ed96bb0d49a9b293f735c01bef Mon Sep 17 00:00:00 2001 From: Jana Radhakrishnan Date: Fri, 15 Apr 2016 16:34:09 -0700 Subject: [PATCH] Need boltdb Register only in tests Fixing an earlier commit which needlessly registered boltdb in allocator.go while it is needed only for tests. Signed-off-by: Jana Radhakrishnan --- libnetwork/ipam/allocator.go | 5 ----- libnetwork/ipam/allocator_test.go | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libnetwork/ipam/allocator.go b/libnetwork/ipam/allocator.go index 255f8932c0..9ff3301baa 100644 --- a/libnetwork/ipam/allocator.go +++ b/libnetwork/ipam/allocator.go @@ -6,7 +6,6 @@ import ( "sync" log "github.com/Sirupsen/logrus" - "github.com/docker/libkv/store/boltdb" "github.com/docker/libnetwork/bitseq" "github.com/docker/libnetwork/datastore" "github.com/docker/libnetwork/discoverapi" @@ -26,10 +25,6 @@ const ( dsDataKey = "ipam/" + ipamapi.DefaultIPAM + "/data" ) -func init() { - boltdb.Register() -} - // Allocator provides per address space ipv4/ipv6 book keeping type Allocator struct { // Predefined pools for default address spaces diff --git a/libnetwork/ipam/allocator_test.go b/libnetwork/ipam/allocator_test.go index c5c07e83d4..c7f84a6122 100644 --- a/libnetwork/ipam/allocator_test.go +++ b/libnetwork/ipam/allocator_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/docker/libkv/store" + "github.com/docker/libkv/store/boltdb" "github.com/docker/libnetwork/bitseq" "github.com/docker/libnetwork/datastore" "github.com/docker/libnetwork/ipamapi" @@ -24,6 +25,10 @@ const ( defaultPrefix = "/tmp/libnetwork/test/ipam" ) +func init() { + boltdb.Register() +} + // OptionBoltdbWithRandomDBFile function returns a random dir for local store backend func randomLocalStore() (datastore.DataStore, error) { tmp, err := ioutil.TempFile("", "libnetwork-")