Skip to content

Commit c95bb88

Browse files
Merge pull request #2634 from jhowardmsft/boltdb
Move to supported boltdb
2 parents 1950f79 + 8e44270 commit c95bb88

55 files changed

Lines changed: 606 additions & 323 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

metadata/bolt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package metadata
1919
import (
2020
"context"
2121

22-
"github.com/boltdb/bolt"
2322
"github.com/pkg/errors"
23+
bolt "go.etcd.io/bbolt"
2424
)
2525

2626
type transactionKey struct{}

metadata/boltutil/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package boltutil
1919
import (
2020
"time"
2121

22-
"github.com/boltdb/bolt"
2322
"github.com/pkg/errors"
23+
bolt "go.etcd.io/bbolt"
2424
)
2525

2626
var (

metadata/buckets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package metadata
1818

1919
import (
20-
"github.com/boltdb/bolt"
2120
digest "github.com/opencontainers/go-digest"
21+
bolt "go.etcd.io/bbolt"
2222
)
2323

2424
// The layout where a "/" delineates a bucket is described in the following

metadata/containers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"strings"
2222
"time"
2323

24-
"github.com/boltdb/bolt"
2524
"github.com/containerd/containerd/containers"
2625
"github.com/containerd/containerd/errdefs"
2726
"github.com/containerd/containerd/filters"
@@ -32,6 +31,7 @@ import (
3231
"github.com/gogo/protobuf/proto"
3332
"github.com/gogo/protobuf/types"
3433
"github.com/pkg/errors"
34+
bolt "go.etcd.io/bbolt"
3535
)
3636

3737
type containerStore struct {

metadata/containers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"testing"
2828
"time"
2929

30-
"github.com/boltdb/bolt"
3130
"github.com/containerd/containerd/containers"
3231
"github.com/containerd/containerd/errdefs"
3332
"github.com/containerd/containerd/filters"
@@ -36,6 +35,7 @@ import (
3635
"github.com/gogo/protobuf/types"
3736
specs "github.com/opencontainers/runtime-spec/specs-go"
3837
"github.com/pkg/errors"
38+
bolt "go.etcd.io/bbolt"
3939
)
4040

4141
func init() {

metadata/content.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"sync"
2424
"time"
2525

26-
"github.com/boltdb/bolt"
2726
"github.com/containerd/containerd/content"
2827
"github.com/containerd/containerd/errdefs"
2928
"github.com/containerd/containerd/filters"
@@ -34,6 +33,7 @@ import (
3433
digest "github.com/opencontainers/go-digest"
3534
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
3635
"github.com/pkg/errors"
36+
bolt "go.etcd.io/bbolt"
3737
)
3838

3939
type contentStore struct {

metadata/content_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"sync/atomic"
2525
"testing"
2626

27-
"github.com/boltdb/bolt"
2827
"github.com/containerd/containerd/content"
2928
"github.com/containerd/containerd/content/local"
3029
"github.com/containerd/containerd/content/testsuite"
@@ -34,6 +33,7 @@ import (
3433
digest "github.com/opencontainers/go-digest"
3534
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
3635
"github.com/pkg/errors"
36+
bolt "go.etcd.io/bbolt"
3737
)
3838

3939
func createContentStore(ctx context.Context, root string) (context.Context, content.Store, func() error, error) {

metadata/db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ import (
2323
"sync"
2424
"time"
2525

26-
"github.com/boltdb/bolt"
2726
"github.com/containerd/containerd/content"
2827
"github.com/containerd/containerd/gc"
2928
"github.com/containerd/containerd/log"
3029
"github.com/containerd/containerd/snapshots"
3130
"github.com/pkg/errors"
31+
bolt "go.etcd.io/bbolt"
3232
)
3333

3434
const (
@@ -43,7 +43,7 @@ const (
4343
// dbVersion represents updates to the schema
4444
// version which are additions and compatible with
4545
// prior version of the same schema.
46-
dbVersion = 2
46+
dbVersion = 3
4747
)
4848

4949
// DB represents a metadata database backed by a bolt

metadata/db_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"testing"
3131
"time"
3232

33-
"github.com/boltdb/bolt"
3433
"github.com/containerd/containerd/containers"
3534
"github.com/containerd/containerd/content"
3635
"github.com/containerd/containerd/content/local"
@@ -44,6 +43,7 @@ import (
4443
digest "github.com/opencontainers/go-digest"
4544
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
4645
"github.com/pkg/errors"
46+
bolt "go.etcd.io/bbolt"
4747
)
4848

4949
func testDB(t *testing.T) (context.Context, *DB, func()) {
@@ -265,6 +265,16 @@ func TestMigrations(t *testing.T) {
265265
return nil
266266
},
267267
},
268+
269+
{
270+
name: "NoOp",
271+
init: func(tx *bolt.Tx) error {
272+
return nil
273+
},
274+
check: func(tx *bolt.Tx) error {
275+
return nil
276+
},
277+
},
268278
}
269279

270280
if len(migrationTests) != len(migrations) {

metadata/gc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
"strings"
2424
"time"
2525

26-
"github.com/boltdb/bolt"
2726
"github.com/containerd/containerd/gc"
2827
"github.com/containerd/containerd/log"
2928
"github.com/pkg/errors"
29+
bolt "go.etcd.io/bbolt"
3030
)
3131

3232
const (

0 commit comments

Comments
 (0)