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

Add the Connect api to get the shim's info.

Signed-off-by: fupan <lifupan@gmail.com>
This commit is contained in:
fupan 2018-11-19 11:36:06 +08:00
parent ec4f27b4c6
commit 87f591a697

View File

@ -534,7 +534,14 @@ func (s *service) Checkpoint(ctx context.Context, r *taskAPI.CheckpointTaskReque
// Connect returns shim information such as the shim's pid
func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*taskAPI.ConnectResponse, error) {
return nil, errdefs.ErrNotImplemented
s.Lock()
defer s.Unlock()
return &taskAPI.ConnectResponse{
ShimPid: s.pid,
//Since kata cannot get the container's pid in VM, thus only return the shim's pid.
TaskPid: s.pid,
}, nil
}
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) {