containerd-shim-kata-v2: add the service Resume support

Add the Resume api support to resume a paused container.

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
This commit is contained in:
ZeroMagic 2018-08-09 10:31:58 +08:00 committed by fupan
parent 8df33d34e8
commit 9ee53be986

View File

@ -523,7 +523,26 @@ func (s *service) Pause(ctx context.Context, r *taskAPI.PauseRequest) (*ptypes.E
// Resume the container // Resume the container
func (s *service) Resume(ctx context.Context, r *taskAPI.ResumeRequest) (*ptypes.Empty, error) { 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 // Kill a process with the provided signal