From 2ddb16d4c8ace2da51f4abd94efd463c637e8808 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 7 Dec 2020 11:58:10 +0100 Subject: container create: do not clear image name When creating a container, do not clear the input-image name before looking up image names. Also add a regression test. Fixes: #8558 Signed-off-by: Valentin Rothberg Signed-off-by: Matthew Heon --- test/system/030-run.bats | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/system/030-run.bats b/test/system/030-run.bats index 71831da10..bf7f67f7f 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -532,6 +532,17 @@ json-file | f run_podman untag $IMAGE $newtag $newtag2 } +# Regression test for issue #8558 +@test "podman run on untagged image: make sure that image metadata is set" { + run_podman inspect $IMAGE --format "{{.ID}}" + imageID="$output" + + run_podman untag $IMAGE + run_podman run --rm $imageID ls + + run_podman tag $imageID $IMAGE +} + @test "podman run with --net=host and --port prints warning" { run_podman run -d --rm -p 8080 --net=host $IMAGE ls > /dev/null is "$output" ".*Port mappings have been discarded as one of the Host, Container, Pod, and None network modes are in use" -- cgit v1.2.3-54-g00ecf