1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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 <mrjana@docker.com>
This commit is contained in:
Jana Radhakrishnan 2016-04-15 16:34:09 -07:00
parent 52a35304e0
commit 716af1c1ee
2 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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-")