diff --git a/server/container_create.go b/server/container_create.go index 4638ef27..ee855d19 100644 --- a/server/container_create.go +++ b/server/container_create.go @@ -271,6 +271,10 @@ func (s *Server) createSandboxContainer(containerID string, containerName string // Join the namespace paths for the pod sandbox container. 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) for nsType, nsFile := range map[string]string{