Add kill API for execution service
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
parent
6132bec05a
commit
4764429cbe
5 changed files with 300 additions and 39 deletions
|
@ -185,6 +185,17 @@ func (s *Service) List(ctx context.Context, r *api.ListRequest) (*api.ListRespon
|
|||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *Service) Kill(ctx context.Context, r *api.KillRequest) (*google_protobuf.Empty, error) {
|
||||
c, err := s.getContainer(r.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := c.Kill(ctx, r.Signal, r.All); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return empty, nil
|
||||
}
|
||||
|
||||
func (s *Service) Events(r *api.EventsRequest, server api.ContainerService_EventsServer) error {
|
||||
w := &grpcEventWriter{
|
||||
server: server,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue