containerd/supervisor/create.go
Michael Crosby 36eb83cb99 Move fifo creation to client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-03 13:56:15 -08:00

37 lines
728 B
Go

package supervisor
import (
"time"
"github.com/docker/containerd/runtime"
)
type StartEvent struct {
s *Supervisor
}
func (h *StartEvent) Handle(e *Event) error {
start := time.Now()
container, err := runtime.New(h.s.stateDir, e.ID, e.BundlePath)
if err != nil {
return err
}
h.s.containers[e.ID] = &containerInfo{
container: container,
}
ContainersCounter.Inc(1)
task := &StartTask{
Err: e.Err,
Container: container,
StartResponse: e.StartResponse,
Stdin: e.Stdin,
Stdout: e.Stdout,
Stderr: e.Stderr,
}
if e.Checkpoint != nil {
task.Checkpoint = e.Checkpoint.Name
}
h.s.tasks <- task
ContainerCreateTimer.UpdateSince(start)
return errDeferedResponse
}