Add oom support to events
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
70a8c1ec3f
commit
500ca74f38
10 changed files with 201 additions and 256 deletions
22
supervisor/oom.go
Normal file
22
supervisor/oom.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package supervisor
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
type OOMTask struct {
|
||||
baseTask
|
||||
ID string
|
||||
}
|
||||
|
||||
func (s *Supervisor) oom(t *OOMTask) error {
|
||||
logrus.WithField("id", t.ID).Debug("containerd: container oom")
|
||||
s.notifySubscribers(Event{
|
||||
Timestamp: time.Now(),
|
||||
ID: t.ID,
|
||||
Type: "oom",
|
||||
})
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue