4e05bf491a
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
31 lines
658 B
Go
31 lines
658 B
Go
package supervisor
|
|
|
|
import "github.com/docker/containerd/runtime"
|
|
|
|
type CreateCheckpointTask struct {
|
|
baseTask
|
|
ID string
|
|
Checkpoint *runtime.Checkpoint
|
|
}
|
|
|
|
func (s *Supervisor) createCheckpoint(t *CreateCheckpointTask) error {
|
|
i, ok := s.containers[t.ID]
|
|
if !ok {
|
|
return ErrContainerNotFound
|
|
}
|
|
return i.container.Checkpoint(*t.Checkpoint)
|
|
}
|
|
|
|
type DeleteCheckpointTask struct {
|
|
baseTask
|
|
ID string
|
|
Checkpoint *runtime.Checkpoint
|
|
}
|
|
|
|
func (s *Supervisor) deleteCheckpoint(t *DeleteCheckpointTask) error {
|
|
i, ok := s.containers[t.ID]
|
|
if !ok {
|
|
return ErrContainerNotFound
|
|
}
|
|
return i.container.DeleteCheckpoint(t.Checkpoint.Name)
|
|
}
|