containerd/supervisor/checkpoint.go
Ross Boucher e756ae42d1 Add support for specifying a checkpoint directory. (#245)
Signed-off-by: Ross Boucher <rboucher@gmail.com>
2016-05-25 17:42:37 -07:00

35 lines
768 B
Go

// +build !windows
package supervisor
import "github.com/docker/containerd/runtime"
type CreateCheckpointTask struct {
baseTask
ID string
CheckpointDir 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, t.CheckpointDir)
}
type DeleteCheckpointTask struct {
baseTask
ID string
CheckpointDir 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, t.CheckpointDir)
}