server: sync ctr state before checking it

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-12-06 12:39:38 +01:00
parent 79073df3c2
commit 1b2d4f3d60
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
4 changed files with 92 additions and 2 deletions

View file

@ -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 {