summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-10-21 15:25:17 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-10-21 16:51:09 +0200
commit410fa53f89b1c408ce57318bb054b4229ad845d5 (patch)
tree4cb1848771aeedd3b5c0d8d9b3711d9925d3c06f /test
parent9d9c58ba64a59fc24d6807f495559ac2ec86b6e8 (diff)
downloadpodman-410fa53f89b1c408ce57318bb054b4229ad845d5.tar.gz
podman-410fa53f89b1c408ce57318bb054b4229ad845d5.tar.bz2
podman-410fa53f89b1c408ce57318bb054b4229ad845d5.zip
container create: record correct image name
Record the correct image name when creating a container by using the resolved image name if present. Otherwise, default to using the first available name or an empty string in which case the image must have been referenced by ID. Fixes: #8082 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/030-run.bats19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 9f4037730..8712dc72d 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -473,4 +473,23 @@ json-file | f
run_podman kill $cid
}
+# Regression test for issue #8082
+@test "podman run : look up correct image name" {
+ # Create a 2nd tag for the local image.
+ local name="localhost/foo/bar"
+ run_podman tag $IMAGE $name
+
+ # Create a container with the 2nd tag and make sure that it's being
+ # used. #8082 always inaccurately used the 1st tag.
+ run_podman create $name
+ cid="$output"
+
+ run_podman inspect --format "{{.ImageName}}" $cid
+ is "$output" "$name"
+
+ # Clean up.
+ run_podman rm $cid
+ run_podman untag $IMAGE $name
+}
+
# vim: filetype=sh