Move plugin context events into separate plugin

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2021-08-05 21:50:40 -07:00
parent 7d4891783a
commit 0a0621bb47
19 changed files with 137 additions and 16 deletions

View File

@@ -92,6 +92,11 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
return nil, err
}
ep, err := ic.Get(plugin.EventPlugin)
if err != nil {
return nil, err
}
monitor, err := ic.Get(plugin.TaskMonitorPlugin)
if err != nil {
if !errdefs.IsNotFound(err) {
@@ -105,7 +110,7 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
runtimes: runtimes,
containers: metadata.NewContainerStore(db),
store: db.ContentStore(),
publisher: ic.Events,
publisher: ep.(events.Publisher),
monitor: monitor.(runtime.TaskMonitor),
v2Runtime: v2r.(*v2.TaskManager),
}