Add pause/unpause implementation

This adds pause and unpause to containerd's execution service and the
same commands to the `ctr` client.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
Phil Estes
2017-05-05 10:11:08 -04:00
parent ae93c236ff
commit 91410874e7
17 changed files with 512 additions and 63 deletions

View File

@@ -188,6 +188,30 @@ func (s *Service) List(ctx context.Context, r *api.ListRequest) (*api.ListRespon
return resp, nil
}
func (s *Service) Pause(ctx context.Context, r *api.PauseRequest) (*google_protobuf.Empty, error) {
c, err := s.getContainer(r.ID)
if err != nil {
return nil, err
}
err = c.Pause(ctx)
if err != nil {
return nil, err
}
return empty, nil
}
func (s *Service) Resume(ctx context.Context, r *api.ResumeRequest) (*google_protobuf.Empty, error) {
c, err := s.getContainer(r.ID)
if err != nil {
return nil, err
}
err = c.Resume(ctx)
if err != nil {
return nil, err
}
return empty, nil
}
func (s *Service) Kill(ctx context.Context, r *api.KillRequest) (*google_protobuf.Empty, error) {
c, err := s.getContainer(r.ID)
if err != nil {