mirror of
https://github.com/containers/podman.git
synced 2025-12-09 23:27:09 +08:00
Quadlet - add support for UID and GID Mapping
Support UIDMap, GIDMap, SubUIDMap and SubGIDMap If any of them are set disregard the deprecated Remap keys Add tests and man Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
10
test/e2e/quadlet/idmapping-with-remap.container
Normal file
10
test/e2e/quadlet/idmapping-with-remap.container
Normal file
@@ -0,0 +1,10 @@
|
||||
## assert-failed
|
||||
## assert-stderr-contains "deprecated Remap keys are set along with explicit mapping keys"
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
UIDMap=0:10000:10
|
||||
UIDMap=10:20000:10
|
||||
GIDMap=0:10000:10
|
||||
GIDMap=10:20000:10
|
||||
RemapUsers=auto
|
||||
11
test/e2e/quadlet/idmapping.container
Normal file
11
test/e2e/quadlet/idmapping.container
Normal file
@@ -0,0 +1,11 @@
|
||||
## assert-podman-args "--uidmap=0:10000:10"
|
||||
## assert-podman-args "--uidmap=10:20000:10"
|
||||
## assert-podman-args "--gidmap=0:10000:10"
|
||||
## assert-podman-args "--gidmap=10:20000:10"
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
UIDMap=0:10000:10
|
||||
UIDMap=10:20000:10
|
||||
GIDMap=0:10000:10
|
||||
GIDMap=10:20000:10
|
||||
8
test/e2e/quadlet/subidmapping-with-remap.container
Normal file
8
test/e2e/quadlet/subidmapping-with-remap.container
Normal file
@@ -0,0 +1,8 @@
|
||||
## assert-failed
|
||||
## assert-stderr-contains "deprecated Remap keys are set along with explicit mapping keys"
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
SubUIDMap=utest
|
||||
SubGIDMap=gtest
|
||||
RemapUsers=auto
|
||||
7
test/e2e/quadlet/subidmapping.container
Normal file
7
test/e2e/quadlet/subidmapping.container
Normal file
@@ -0,0 +1,7 @@
|
||||
## assert-podman-args "--subuidname" "utest"
|
||||
## assert-podman-args "--subgidname" "gtest"
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
SubUIDMap=utest
|
||||
SubGIDMap=gtest
|
||||
7
test/e2e/quadlet/userns-with-remap.container
Normal file
7
test/e2e/quadlet/userns-with-remap.container
Normal file
@@ -0,0 +1,7 @@
|
||||
## assert-failed
|
||||
## assert-stderr-contains "deprecated Remap keys are set along with explicit mapping keys"
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
RemapUsers=auto
|
||||
UserNS=keep-id
|
||||
5
test/e2e/quadlet/userns.container
Normal file
5
test/e2e/quadlet/userns.container
Normal file
@@ -0,0 +1,5 @@
|
||||
## assert-podman-args "--userns" "keep-id"
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
UserNS=keep-id
|
||||
@@ -690,6 +690,8 @@ BOGUS=foo
|
||||
Entry("exec.container", "exec.container", 0, ""),
|
||||
Entry("health.container", "health.container", 0, ""),
|
||||
Entry("hostname.container", "hostname.container", 0, ""),
|
||||
Entry("idmapping.container", "idmapping.container", 0, ""),
|
||||
Entry("idmapping-with-remap.container", "idmapping-with-remap.container", 1, "converting \"idmapping-with-remap.container\": deprecated Remap keys are set along with explicit mapping keys"),
|
||||
Entry("image.container", "image.container", 0, ""),
|
||||
Entry("install.container", "install.container", 0, ""),
|
||||
Entry("ip.container", "ip.container", 0, ""),
|
||||
@@ -726,10 +728,14 @@ BOGUS=foo
|
||||
Entry("selinux.container", "selinux.container", 0, ""),
|
||||
Entry("shmsize.container", "shmsize.container", 0, ""),
|
||||
Entry("shortname.container", "shortname.container", 0, "Warning: shortname.container specifies the image \"shortname\" which not a fully qualified image name. This is not ideal for performance and security reasons. See the podman-pull manpage discussion of short-name-aliases.conf for details."),
|
||||
Entry("subidmapping.container", "subidmapping.container", 0, ""),
|
||||
Entry("subidmapping-with-remap.container", "subidmapping-with-remap.container", 1, "converting \"subidmapping-with-remap.container\": deprecated Remap keys are set along with explicit mapping keys"),
|
||||
Entry("sysctl.container", "sysctl.container", 0, ""),
|
||||
Entry("timezone.container", "timezone.container", 0, ""),
|
||||
Entry("unmask.container", "unmask.container", 0, ""),
|
||||
Entry("user.container", "user.container", 0, ""),
|
||||
Entry("userns.container", "userns.container", 0, ""),
|
||||
Entry("userns-with-remap.container", "userns-with-remap.container", 1, "converting \"userns-with-remap.container\": deprecated Remap keys are set along with explicit mapping keys"),
|
||||
Entry("volume.container", "volume.container", 0, ""),
|
||||
Entry("workingdir.container", "workingdir.container", 0, ""),
|
||||
Entry("Container - global args", "globalargs.container", 0, ""),
|
||||
|
||||
Reference in New Issue
Block a user