containerd/start.go
Michael Crosby ae9b2bafd5 Add basic checkpoint and restore support
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-03 16:07:53 -08:00

26 lines
507 B
Go

package containerd
type StartEvent struct {
s *Supervisor
}
func (h *StartEvent) Handle(e *Event) error {
container, err := h.s.runtime.Create(e.ID, e.BundlePath, e.Stdio)
if err != nil {
return err
}
h.s.containers[e.ID] = container
ContainersCounter.Inc(1)
task := &StartTask{
Err: e.Err,
Container: container,
}
if e.Checkpoint != nil {
task.Checkpoint = &Checkpoint{
Name: e.Checkpoint.Name,
Path: e.Checkpoint.Path,
}
}
h.s.tasks <- task
return errDeferedResponse
}