Fix panic create container when sb is fail
Signed-off-by: Harry Zhang <harryz@hyper.sh>
This commit is contained in:
parent
80ccc3a455
commit
8073427f76
1 changed files with 4 additions and 0 deletions
|
@ -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{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue