3dc59d565a
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
25 lines
491 B
Go
25 lines
491 B
Go
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)
|
|
}
|