Add support for specifying a checkpoint directory. (#245)
Signed-off-by: Ross Boucher <rboucher@gmail.com>
This commit is contained in:
committed by
Michael Crosby
parent
76dd6710dc
commit
e756ae42d1
@@ -6,8 +6,9 @@ import "github.com/docker/containerd/runtime"
|
||||
|
||||
type CreateCheckpointTask struct {
|
||||
baseTask
|
||||
ID string
|
||||
Checkpoint *runtime.Checkpoint
|
||||
ID string
|
||||
CheckpointDir string
|
||||
Checkpoint *runtime.Checkpoint
|
||||
}
|
||||
|
||||
func (s *Supervisor) createCheckpoint(t *CreateCheckpointTask) error {
|
||||
@@ -15,13 +16,14 @@ func (s *Supervisor) createCheckpoint(t *CreateCheckpointTask) error {
|
||||
if !ok {
|
||||
return ErrContainerNotFound
|
||||
}
|
||||
return i.container.Checkpoint(*t.Checkpoint)
|
||||
return i.container.Checkpoint(*t.Checkpoint, t.CheckpointDir)
|
||||
}
|
||||
|
||||
type DeleteCheckpointTask struct {
|
||||
baseTask
|
||||
ID string
|
||||
Checkpoint *runtime.Checkpoint
|
||||
ID string
|
||||
CheckpointDir string
|
||||
Checkpoint *runtime.Checkpoint
|
||||
}
|
||||
|
||||
func (s *Supervisor) deleteCheckpoint(t *DeleteCheckpointTask) error {
|
||||
@@ -29,5 +31,5 @@ func (s *Supervisor) deleteCheckpoint(t *DeleteCheckpointTask) error {
|
||||
if !ok {
|
||||
return ErrContainerNotFound
|
||||
}
|
||||
return i.container.DeleteCheckpoint(t.Checkpoint.Name)
|
||||
return i.container.DeleteCheckpoint(t.Checkpoint.Name, t.CheckpointDir)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user