From 6996830104afca5926daecc05d9154a0a9eb274d Mon Sep 17 00:00:00 2001 From: cdoern Date: Thu, 13 Jan 2022 10:43:24 -0500 Subject: Prohibit --uid/gid map and --pod for container create/run add a check in namespaceOptions() that ensures the user is not setting a new uid/gid map if entering or creating a pod that has an infra container resolves #12669 Signed-off-by: cdoern --- test/e2e/create_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 9126303cd..a482c0068 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -693,4 +693,17 @@ var _ = Describe("Podman create", func() { Expect(idata[0].Os).To(Equal(runtime.GOOS)) Expect(idata[0].Architecture).To(Equal("arm64")) }) + + It("podman create --uid/gidmap --pod conflict test", func() { + create := podmanTest.Podman([]string{"create", "--uidmap", "0:1000:1000", "--pod", "new:testing123", ALPINE}) + create.WaitWithDefaultTimeout() + Expect(create).ShouldNot(Exit(0)) + Expect(create.ErrorToString()).To(ContainSubstring("cannot specify a new uid/gid map when entering a pod with an infra container")) + + create = podmanTest.Podman([]string{"create", "--gidmap", "0:1000:1000", "--pod", "new:testing1234", ALPINE}) + create.WaitWithDefaultTimeout() + Expect(create).ShouldNot(Exit(0)) + Expect(create.ErrorToString()).To(ContainSubstring("cannot specify a new uid/gid map when entering a pod with an infra container")) + + }) }) -- cgit v1.2.3-54-g00ecf