Move plugin context events into separate plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -63,6 +63,7 @@ func init() {
|
||||
plugin.Register(&plugin.Registration{
|
||||
Type: plugin.InternalPlugin,
|
||||
Requires: []plugin.Type{
|
||||
plugin.EventPlugin,
|
||||
plugin.ServicePlugin,
|
||||
},
|
||||
ID: "restart",
|
||||
@@ -95,8 +96,14 @@ func getServicesOpts(ic *plugin.InitContext) ([]containerd.ServicesOpt, error) {
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get service plugin")
|
||||
}
|
||||
|
||||
ep, err := ic.Get(plugin.EventPlugin)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get event plugin")
|
||||
}
|
||||
|
||||
opts := []containerd.ServicesOpt{
|
||||
containerd.WithEventService(ic.Events),
|
||||
containerd.WithEventService(ep.(containerd.EventService)),
|
||||
}
|
||||
for s, fn := range map[string]func(interface{}) containerd.ServicesOpt{
|
||||
services.ContentService: func(s interface{}) containerd.ServicesOpt {
|
||||
|
||||
Reference in New Issue
Block a user