Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman panics when Image ID is passed to pod create --infra-image #9374

Closed
mheon opened this issue Feb 15, 2021 · 0 comments · Fixed by #9380
Closed

Podman panics when Image ID is passed to pod create --infra-image #9374

mheon opened this issue Feb 15, 2021 · 0 comments · Fixed by #9380
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@mheon
Copy link
Member

mheon commented Feb 15, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

The --infra-image flag to podman pod create panics when an image is specified by its ID, instead of its name. The image in question also had no tags, which could be a contributing factor.

Steps to reproduce the issue:

  1. Select any valid, untagged image available on your system and copy it's ID.

  2. podman pod create --name testpod --infra-image <ID>

Describe the results you received:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/containers/podman/v2/libpod.(*Runtime).createInfraContainer(0xc0005af1e0, 0x1e9c640, 0xc000130010, 0xc000143800, 0xc000723858, 0x1, 0x1)
	libpod/runtime_pod_infra_linux.go:228 +0x2ce
github.com/containers/podman/v2/libpod.(*Runtime).NewPod(0xc0005af1e0, 0x1e9c640, 0xc000130010, 0xc0005bbec0, 0xa, 0xc, 0x0, 0x0, 0x0)
	libpod/runtime_pod_linux.go:135 +0x5c6
github.com/containers/podman/v2/pkg/specgen/generate.MakePod(0xc0007239b0, 0xc0005af1e0, 0xc000138000, 0x7, 0x7)
	pkg/specgen/generate/pod_create.go:20 +0xd7
github.com/containers/podman/v2/pkg/domain/infra/abi.(*ContainerEngine).PodCreate(0xc0005b8880, 0x1e9c640, 0xc000130010, 0x0, 0x0, 0xc000138000, 0x7, 0x7, 0x0, 0x0, ...)
	pkg/domain/infra/abi/pods.go:254 +0xb5
github.com/containers/podman/v2/cmd/podman/pods.create(0x28ca4c0, 0xc00025aac0, 0x0, 0x4, 0x0, 0x0)
	cmd/podman/pods/create.go:188 +0x2d8
github.com/spf13/cobra.(*Command).execute(0x28ca4c0, 0xc000138030, 0x4, 0x4, 0x28ca4c0, 0xc000138030)
	vendor/github.com/spf13/cobra/command.go:852 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0x28d21c0, 0xc000130010, 0x199ab60, 0x29866c0)
	vendor/github.com/spf13/cobra/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	vendor/github.com/spf13/cobra/command.go:897
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	vendor/github.com/spf13/cobra/command.go:890
main.Execute()
	cmd/podman/root.go:92 +0xec
main.main()
	cmd/podman/main.go:37 +0x92

Describe the results you expected:

Pod and infra image are created successfully.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Originally observed on v2.2.1. Reproduces with v3.0 and latest code as well.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 15, 2021
@baude baude self-assigned this Feb 15, 2021
@baude baude added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Feb 15, 2021
baude added a commit to baude/podman that referenced this issue Feb 16, 2021
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: containers#9374

Signed-off-by: baude <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Feb 18, 2021
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: containers#9374

Signed-off-by: baude <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants