Merge pull request #740 from crosbymichael/oom-event

Emit oom events
This commit is contained in:
Qiang Huang
2017-04-20 17:23:24 -05:00
committed by GitHub
6 changed files with 47 additions and 9 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 {