mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 11:06:21 +00:00
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:
parent
ec4f27b4c6
commit
87f591a697
@ -534,7 +534,14 @@ func (s *service) Checkpoint(ctx context.Context, r *taskAPI.CheckpointTaskReque
|
|||||||
|
|
||||||
// Connect returns shim information such as the shim's pid
|
// Connect returns shim information such as the shim's pid
|
||||||
func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*taskAPI.ConnectResponse, error) {
|
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) {
|
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user