containerd/supervisor/checkpoint.go

26 lines
491 B
Go
Raw Normal View History

package supervisor
type CreateCheckpointTask struct {
s *Supervisor
}
func (h *CreateCheckpointTask) Handle(e *Task) error {
i, ok := h.s.containers[e.ID]
if !ok {
return ErrContainerNotFound
}
return i.container.Checkpoint(*e.Checkpoint)
}
type DeleteCheckpointTask struct {
s *Supervisor
}
func (h *DeleteCheckpointTask) Handle(e *Task) error {
i, ok := h.s.containers[e.ID]
if !ok {
return ErrContainerNotFound
}
return i.container.DeleteCheckpoint(e.Checkpoint.Name)
}