Fix panic create container when sb is fail

Signed-off-by: Harry Zhang <harryz@hyper.sh>
This commit is contained in:
Harry Zhang 2016-12-11 16:25:17 +08:00
parent 80ccc3a455
commit 8073427f76

View file

@ -271,6 +271,10 @@ func (s *Server) createSandboxContainer(containerID string, containerName string
// Join the namespace paths for the pod sandbox container. // Join the namespace paths for the pod sandbox container.
podInfraState := s.runtime.ContainerStatus(sb.infraContainer) podInfraState := s.runtime.ContainerStatus(sb.infraContainer)
if podInfraState == nil {
return nil, fmt.Errorf("state of infra container of given sandbox: %q is nil, which is unexpected", sb.metadata.GetName())
}
logrus.Debugf("pod container state %+v", podInfraState) logrus.Debugf("pod container state %+v", podInfraState)
for nsType, nsFile := range map[string]string{ for nsType, nsFile := range map[string]string{