From 0d1aaf080eb116f1e8e23cd55a8bca0ed5f2e596 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 22 Nov 2021 13:48:14 +0100 Subject: image lookup: do not match *any* tags For reasons buried in the history of Podman, looking up an untagged image would match any tag of matching image. For instance, looking up centos would match a local image centos:foobar. Change that behavior to only match the latest tag. Fix: #11964 Signed-off-by: Valentin Rothberg --- test/e2e/pull_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/e2e') diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index c377f158d..fdb1b0c57 100644 --- a/test/e2e/pull_test.go +++ b/test/e2e/pull_test.go @@ -48,7 +48,7 @@ var _ = Describe("Podman pull", func() { found, _ := session.ErrorGrepString(expectedError) Expect(found).To(Equal(true)) - session = podmanTest.Podman([]string{"rmi", "busybox", "alpine", "testdigest_v2s2", "quay.io/libpod/cirros"}) + session = podmanTest.Podman([]string{"rmi", "busybox:musl", "alpine", "quay.io/libpod/cirros", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) }) @@ -104,8 +104,13 @@ var _ = Describe("Podman pull", func() { session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) + // Without a tag/digest the input is normalized with the "latest" tag, see #11964 session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"}) session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(1)) + + session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"}) + session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) }) -- cgit v1.2.3-54-g00ecf