Remove events from init context

Events from the init context have been replaced by the events plugin

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-05-30 18:04:09 -07:00
parent a81f3fb817
commit 2a60fe5a60
8 changed files with 19 additions and 20 deletions

View File

@@ -24,6 +24,7 @@ import (
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/metadata"
"github.com/containerd/containerd/pkg/timeout"
@@ -85,6 +86,7 @@ func init() {
ID: "bolt",
Requires: []plugin.Type{
plugin.ContentPlugin,
plugin.EventPlugin,
plugin.SnapshotPlugin,
},
Config: &BoltConfig{
@@ -117,6 +119,11 @@ func init() {
snapshotters[name] = sn.(snapshots.Snapshotter)
}
ep, err := ic.Get(plugin.EventPlugin)
if err != nil {
return nil, err
}
shared := true
ic.Meta.Exports["policy"] = SharingPolicyShared
if cfg, ok := ic.Config.(*BoltConfig); ok {
@@ -163,7 +170,7 @@ func init() {
}
dbopts := []metadata.DBOpt{
metadata.WithEventsPublisher(ic.Events),
metadata.WithEventsPublisher(ep.(events.Publisher)),
}
if !shared {