server: sync ctr state before checking it
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
79073df3c2
commit
1b2d4f3d60
4 changed files with 92 additions and 2 deletions
|
@ -34,6 +34,9 @@ func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxReque
|
|||
containers = append(containers, podInfraContainer)
|
||||
|
||||
for _, c := range containers {
|
||||
if err := s.runtime.UpdateStatus(c); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cStatus := s.runtime.ContainerStatus(c)
|
||||
if cStatus.Status != oci.ContainerStateStopped {
|
||||
if err := s.runtime.StopContainer(c); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue