server: honor container stop timeout from CRI
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
20e9aeb16f
commit
b3683ab184
6 changed files with 29 additions and 21 deletions
|
@ -22,7 +22,7 @@ func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest
|
|||
}
|
||||
cStatus := s.runtime.ContainerStatus(c)
|
||||
if cStatus.Status != oci.ContainerStateStopped {
|
||||
if err := s.runtime.StopContainer(c); err != nil {
|
||||
if err := s.runtime.StopContainer(c, req.Timeout); err != nil {
|
||||
return nil, fmt.Errorf("failed to stop container %s: %v", c.ID(), err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue