diff options
author | cdoern <cdoern@redhat.com> | 2022-01-13 10:43:24 -0500 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2022-01-13 14:03:51 -0500 |
commit | 6996830104afca5926daecc05d9154a0a9eb274d (patch) | |
tree | 006755309d1dfd265411390c08f1ddc9900cc76a /test/e2e | |
parent | e98058a3cf4f5ba4cd2d37dfdb2a0951b9aa9730 (diff) | |
download | podman-6996830104afca5926daecc05d9154a0a9eb274d.tar.gz podman-6996830104afca5926daecc05d9154a0a9eb274d.tar.bz2 podman-6996830104afca5926daecc05d9154a0a9eb274d.zip |
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 <cdoern@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/create_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
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")) + + }) }) |