e213e2eb62
Move all constants for event types to types.go for easier code readability and maintainance. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
22 lines
340 B
Go
22 lines
340 B
Go
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: StateOOM,
|
|
})
|
|
return nil
|
|
}
|