Create metadata db object
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -28,17 +28,17 @@ func init() {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewService(m.(*bolt.DB), ic.Events), nil
|
||||
return NewService(m.(*metadata.DB), ic.Events), nil
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
db *bolt.DB
|
||||
db *metadata.DB
|
||||
publisher events.Publisher
|
||||
}
|
||||
|
||||
func NewService(db *bolt.DB, publisher events.Publisher) api.ContainersServer {
|
||||
func NewService(db *metadata.DB, publisher events.Publisher) api.ContainersServer {
|
||||
return &Service{db: db, publisher: publisher}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"github.com/boltdb/bolt"
|
||||
api "github.com/containerd/containerd/api/services/content/v1"
|
||||
eventsapi "github.com/containerd/containerd/api/services/events/v1"
|
||||
"github.com/containerd/containerd/content"
|
||||
@@ -56,7 +55,9 @@ func NewService(ic *plugin.InitContext) (interface{}, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs := metadata.NewContentStore(m.(*bolt.DB), c.(content.Store))
|
||||
|
||||
cs := metadata.NewContentStore(m.(*metadata.DB), c.(content.Store))
|
||||
|
||||
return &Service{
|
||||
store: cs,
|
||||
publisher: ic.Events,
|
||||
|
||||
@@ -28,17 +28,17 @@ func init() {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewService(m.(*bolt.DB), ic.Events), nil
|
||||
return NewService(m.(*metadata.DB), ic.Events), nil
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
db *bolt.DB
|
||||
db *metadata.DB
|
||||
publisher events.Publisher
|
||||
}
|
||||
|
||||
func NewService(db *bolt.DB, publisher events.Publisher) imagesapi.ImagesServer {
|
||||
func NewService(db *metadata.DB, publisher events.Publisher) imagesapi.ImagesServer {
|
||||
return &Service{
|
||||
db: db,
|
||||
publisher: publisher,
|
||||
|
||||
@@ -29,19 +29,19 @@ func init() {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewService(m.(*bolt.DB), ic.Events), nil
|
||||
return NewService(m.(*metadata.DB), ic.Events), nil
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
db *bolt.DB
|
||||
db *metadata.DB
|
||||
publisher events.Publisher
|
||||
}
|
||||
|
||||
var _ api.NamespacesServer = &Service{}
|
||||
|
||||
func NewService(db *bolt.DB, publisher events.Publisher) api.NamespacesServer {
|
||||
func NewService(db *metadata.DB, publisher events.Publisher) api.NamespacesServer {
|
||||
return &Service{
|
||||
db: db,
|
||||
publisher: publisher,
|
||||
|
||||
@@ -3,7 +3,6 @@ package snapshot
|
||||
import (
|
||||
gocontext "context"
|
||||
|
||||
"github.com/boltdb/bolt"
|
||||
eventsapi "github.com/containerd/containerd/api/services/events/v1"
|
||||
snapshotapi "github.com/containerd/containerd/api/services/snapshot/v1"
|
||||
"github.com/containerd/containerd/api/types"
|
||||
@@ -50,7 +49,7 @@ func newService(ic *plugin.InitContext) (interface{}, error) {
|
||||
}
|
||||
snapshotters := make(map[string]snapshot.Snapshotter)
|
||||
for name, sn := range rawSnapshotters {
|
||||
snapshotters[name] = metadata.NewSnapshotter(md.(*bolt.DB), name, sn.(snapshot.Snapshotter))
|
||||
snapshotters[name] = metadata.NewSnapshotter(md.(*metadata.DB), name, sn.(snapshot.Snapshotter))
|
||||
}
|
||||
|
||||
if len(snapshotters) == 0 {
|
||||
|
||||
@@ -63,7 +63,7 @@ func New(ic *plugin.InitContext) (interface{}, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs := metadata.NewContentStore(m.(*bolt.DB), ct.(content.Store))
|
||||
cs := metadata.NewContentStore(m.(*metadata.DB), ct.(content.Store))
|
||||
runtimes := make(map[string]runtime.Runtime)
|
||||
for _, rr := range rt {
|
||||
r := rr.(runtime.Runtime)
|
||||
@@ -71,7 +71,7 @@ func New(ic *plugin.InitContext) (interface{}, error) {
|
||||
}
|
||||
return &Service{
|
||||
runtimes: runtimes,
|
||||
db: m.(*bolt.DB),
|
||||
db: m.(*metadata.DB),
|
||||
store: cs,
|
||||
publisher: ic.Events,
|
||||
}, nil
|
||||
@@ -79,7 +79,7 @@ func New(ic *plugin.InitContext) (interface{}, error) {
|
||||
|
||||
type Service struct {
|
||||
runtimes map[string]runtime.Runtime
|
||||
db *bolt.DB
|
||||
db *metadata.DB
|
||||
store content.Store
|
||||
publisher events.Publisher
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user