5624732128
* Add a new lint rule to the Makefile Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Fix linter errors Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Allow replacing the default apt mirror Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
37 lines
914 B
Go
37 lines
914 B
Go
// +build !windows
|
|
|
|
package supervisor
|
|
|
|
import "github.com/docker/containerd/runtime"
|
|
|
|
// CreateCheckpointTask holds needed parameters to create a new checkpoint
|
|
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)
|
|
}
|
|
|
|
// DeleteCheckpointTask holds needed parameters to delete a checkpoint
|
|
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)
|
|
}
|