From c6b42c8a72f2ab447d9b588aca3bfff8ca0ee70d Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Thu, 26 Oct 2023 10:20:43 +0200 Subject: [PATCH] Make e2e node image ID test more flexible Container runtimes like CRI-O actually show the image identifier in the `ImageID` field rather than the repo digest. For the digest we already have the `Image` field. We still allow the digest in the `ImageID` field for historic reasons. Signed-off-by: Sascha Grunert --- test/e2e_node/image_id_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/e2e_node/image_id_test.go b/test/e2e_node/image_id_test.go index 179bc70819c..eaa617bd1c9 100644 --- a/test/e2e_node/image_id_test.go +++ b/test/e2e_node/image_id_test.go @@ -60,12 +60,12 @@ var _ = SIGDescribe("ImageID [NodeFeature: ImageID]", func() { framework.ExpectNoError(err) status := runningPod.Status - - if len(status.ContainerStatuses) == 0 { - framework.Failf("Unexpected pod status; %s", dump.Pretty(status)) - return - } - - gomega.Expect(status.ContainerStatuses[0].ImageID).To(gomega.ContainSubstring(busyBoxImage)) + gomega.Expect(status.ContainerStatuses).To(gomega.HaveLen(1), dump.Pretty(status)) + gomega.Expect(status.ContainerStatuses[0].ImageID).To( + gomega.SatisfyAny( + gomega.Equal(busyBoxImage), + gomega.MatchRegexp(`[[:xdigit:]]{64}`), + ), + ) }) })