Add oom event to monitors

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-04-13 15:18:43 -07:00
parent e745efdddb
commit eba88c1752
3 changed files with 32 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ func New(ic *plugin.InitContext) (interface{}, error) {
cfg.Runtime = defaultRuntime
}
c, cancel := context.WithCancel(ic.Context)
return &Runtime{
r := &Runtime{
root: path,
remote: !cfg.NoShim,
runtime: cfg.Runtime,
@@ -64,7 +64,10 @@ func New(ic *plugin.InitContext) (interface{}, error) {
eventsContext: c,
eventsCancel: cancel,
monitor: ic.Monitor,
}, nil
}
// set the events output for a monitor if it generates events
ic.Monitor.Events(r.events)
return r, nil
}
type Runtime struct {