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 <sgrunert@redhat.com>
This commit is contained in:
Sascha Grunert 2023-10-26 10:20:43 +02:00
parent 015297a577
commit c6b42c8a72
No known key found for this signature in database
GPG Key ID: 09D97D153EF94D93

View File

@ -60,12 +60,12 @@ var _ = SIGDescribe("ImageID [NodeFeature: ImageID]", func() {
framework.ExpectNoError(err) framework.ExpectNoError(err)
status := runningPod.Status status := runningPod.Status
gomega.Expect(status.ContainerStatuses).To(gomega.HaveLen(1), dump.Pretty(status))
if len(status.ContainerStatuses) == 0 { gomega.Expect(status.ContainerStatuses[0].ImageID).To(
framework.Failf("Unexpected pod status; %s", dump.Pretty(status)) gomega.SatisfyAny(
return gomega.Equal(busyBoxImage),
} gomega.MatchRegexp(`[[:xdigit:]]{64}`),
),
gomega.Expect(status.ContainerStatuses[0].ImageID).To(gomega.ContainSubstring(busyBoxImage)) )
}) })
}) })