From 9713118a41ca6bf15efdd000e7fbc624b5d93170 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Wed, 14 Feb 2018 18:03:38 +0100 Subject: [PATCH] pkg: validate: validate Username not empty in ImageStatus Kubernetes rely on that Username field to provide RunAsUser, we need to validate runtimes correctly return it. We had recently an issue in CRI-O for that. Signed-off-by: Antonio Murdaca --- pkg/validate/image.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/validate/image.go b/pkg/validate/image.go index 45c2e7139d..f0e48451a3 100644 --- a/pkg/validate/image.go +++ b/pkg/validate/image.go @@ -70,6 +70,18 @@ var _ = framework.KubeDescribe("Image Manager", func() { Expect(status.Size_).NotTo(BeNil(), "Image Size should not be nil") }) + It("image status get image fields should not have Uid empty [Conformance]", func() { + // runcom/imageuser has been built with a dockerfile having USER 1002 + // we test that that user is returned in image status + framework.PullPublicImage(c, "runcom/imageuser") + + defer removeImage(c, "runcom/imageuser") + + status := framework.ImageStatus(c, "runcom/imageuser") + Expect(status.GetUid()).NotTo(BeNil(), "Image Uid should not be empty") + Expect(status.GetUid().GetValue()).To(Equal(1002), "Image Uid should be 1002") + }) + It("listImage should get exactly 3 image in the result list [Conformance]", func() { // different tags refer to different images testImageList := []string{