summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-16 09:25:28 -0500
committerGitHub <noreply@github.com>2021-02-16 09:25:28 -0500
commitaadb16da383a91489821969247bced2b34d885e7 (patch)
treeb36408622b0f292733342e8a95576b3b0638be88 /libpod
parent3eb2ce34dc4392e1b758732201d5a6dd5033584c (diff)
parentf2f18768a8c705a0a15abe814aaa52640af0b279 (diff)
downloadpodman-aadb16da383a91489821969247bced2b34d885e7.tar.gz
podman-aadb16da383a91489821969247bced2b34d885e7.tar.bz2
podman-aadb16da383a91489821969247bced2b34d885e7.zip
Merge pull request #9380 from baude/podinfra
Fix panic in pod creation
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_pod_infra_linux.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go
index bc37bdb23..c6f268182 100644
--- a/libpod/runtime_pod_infra_linux.go
+++ b/libpod/runtime_pod_infra_linux.go
@@ -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)