Add oom notifications and pid to create response

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2015-12-15 16:22:53 -08:00
parent ec31245f54
commit 76cf593212
13 changed files with 269 additions and 128 deletions

View File

@@ -62,6 +62,10 @@ var daemonFlags = []cli.Flag{
Value: "/run/containerd/containerd.sock",
Usage: "Address on which GRPC API will listen",
},
cli.BoolFlag{
Name: "oom-notify",
Usage: "enable oom notifications for containers",
},
}
func main() {
@@ -89,6 +93,7 @@ func main() {
context.String("listen"),
context.String("state-dir"),
context.Int("concurrency"),
context.Bool("oom-notify"),
); err != nil {
logrus.Fatal(err)
}
@@ -146,9 +151,9 @@ func processMetrics() {
}()
}
func daemon(id, address, stateDir string, concurrency int) error {
func daemon(id, address, stateDir string, concurrency int, oom bool) error {
tasks := make(chan *containerd.StartTask, concurrency*100)
supervisor, err := containerd.NewSupervisor(id, stateDir, tasks)
supervisor, err := containerd.NewSupervisor(id, stateDir, tasks, oom)
if err != nil {
return err
}