2016-02-29 22:15:16 +00:00
|
|
|
package supervisor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
2016-06-03 22:00:49 +00:00
|
|
|
// OOMTask holds needed parameters to report a container OOM
|
2016-02-29 22:15:16 +00:00
|
|
|
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,
|
2016-04-19 11:02:37 +00:00
|
|
|
Type: StateOOM,
|
2016-02-29 22:15:16 +00:00
|
|
|
})
|
|
|
|
return nil
|
|
|
|
}
|