diff --git a/images/image-user/Dockerfile b/images/image-user/Dockerfile new file mode 100644 index 0000000000..e42c7a1020 --- /dev/null +++ b/images/image-user/Dockerfile @@ -0,0 +1,16 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM busybox +USER 1002 diff --git a/pkg/validate/image.go b/pkg/validate/image.go index efa838796c..4af85dfb46 100644 --- a/pkg/validate/image.go +++ b/pkg/validate/image.go @@ -66,6 +66,18 @@ var _ = framework.KubeDescribe("Image Manager", func() { }) }) + 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(int64(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{