containerd/checkpoint.go
Michael Crosby 9eb08b8971 Refactor checkpoint information
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-04 14:00:07 -08:00

25 lines
509 B
Go

package containerd
type CreateCheckpointEvent struct {
s *Supervisor
}
func (h *CreateCheckpointEvent) Handle(e *Event) error {
container, ok := h.s.containers[e.ID]
if !ok {
return ErrContainerNotFound
}
return container.Checkpoint(*e.Checkpoint)
}
type DeleteCheckpointEvent struct {
s *Supervisor
}
func (h *DeleteCheckpointEvent) Handle(e *Event) error {
container, ok := h.s.containers[e.ID]
if !ok {
return ErrContainerNotFound
}
return container.DeleteCheckpoint(e.Checkpoint.Name)
}