Remove eventloop package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
4de168877b
commit
4e05bf491a
15 changed files with 265 additions and 359 deletions
|
@ -1,25 +1,31 @@
|
|||
package supervisor
|
||||
|
||||
import "github.com/docker/containerd/runtime"
|
||||
|
||||
type CreateCheckpointTask struct {
|
||||
s *Supervisor
|
||||
baseTask
|
||||
ID string
|
||||
Checkpoint *runtime.Checkpoint
|
||||
}
|
||||
|
||||
func (h *CreateCheckpointTask) Handle(e *Task) error {
|
||||
i, ok := h.s.containers[e.ID]
|
||||
func (s *Supervisor) createCheckpoint(t *CreateCheckpointTask) error {
|
||||
i, ok := s.containers[t.ID]
|
||||
if !ok {
|
||||
return ErrContainerNotFound
|
||||
}
|
||||
return i.container.Checkpoint(*e.Checkpoint)
|
||||
return i.container.Checkpoint(*t.Checkpoint)
|
||||
}
|
||||
|
||||
type DeleteCheckpointTask struct {
|
||||
s *Supervisor
|
||||
baseTask
|
||||
ID string
|
||||
Checkpoint *runtime.Checkpoint
|
||||
}
|
||||
|
||||
func (h *DeleteCheckpointTask) Handle(e *Task) error {
|
||||
i, ok := h.s.containers[e.ID]
|
||||
func (s *Supervisor) deleteCheckpoint(t *DeleteCheckpointTask) error {
|
||||
i, ok := s.containers[t.ID]
|
||||
if !ok {
|
||||
return ErrContainerNotFound
|
||||
}
|
||||
return i.container.DeleteCheckpoint(e.Checkpoint.Name)
|
||||
return i.container.DeleteCheckpoint(t.Checkpoint.Name)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue