mirror of
https://github.com/containers/podman.git
synced 2025-10-25 02:04:43 +08:00
Fix panic in pod creation
when creating a pod with --infra-image and using a untagged image for the infra-image (none/none), the lookup for the image's name was creating a panic. Fixes: #9374 Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -225,7 +225,10 @@ func (r *Runtime) createInfraContainer(ctx context.Context, p *Pod) (*Container,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
imageName := newImage.Names()[0]
|
||||
imageName := "none"
|
||||
if len(newImage.Names()) > 0 {
|
||||
imageName = newImage.Names()[0]
|
||||
}
|
||||
imageID := data.ID
|
||||
|
||||
return r.makeInfraContainer(ctx, p, imageName, r.config.Engine.InfraImage, imageID, data.Config)
|
||||
|
||||
Reference in New Issue
Block a user