mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 18:47:03 +00:00
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:
parent
8df33d34e8
commit
9ee53be986
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user