Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
containerd-shim-kata-v2: add the service Resume support
Browse files Browse the repository at this point in the history
Add the Resume api support to resume a paused container.

Signed-off-by: ZeroMagic <[email protected]>
  • Loading branch information
ZeroMagic authored and lifupan committed Nov 28, 2018
1 parent 8df33d3 commit 9ee53be
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion containerd-shim-v2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,26 @@ func (s *service) Pause(ctx context.Context, r *taskAPI.PauseRequest) (*ptypes.E

// Resume the container
func (s *service) Resume(ctx context.Context, r *taskAPI.ResumeRequest) (*ptypes.Empty, error) {
return nil, errdefs.ErrNotImplemented
s.Lock()
defer s.Unlock()

c, err := s.getContainer(r.ID)
if err != nil {
return nil, err
}

err = s.sandbox.ResumeContainer(c.id)
if err == nil {
c.status = task.StatusRunning
return empty, nil
}

c.status, err = s.getContainerStatus(c.id)
if err != nil {
c.status = task.StatusUnknown
}

return empty, err
}

// Kill a process with the provided signal
Expand Down

0 comments on commit 9ee53be

Please sign in to comment.