mirror of
https://github.com/containers/podman-compose.git
synced 2025-02-09 14:59:26 +01:00
commit
f2f2f15a3b
@ -981,6 +981,8 @@ async def container_to_args(compose, cnt, detached=True):
|
||||
podman_args.append("--tty")
|
||||
if cnt.get("privileged", None):
|
||||
podman_args.append("--privileged")
|
||||
if cnt.get("pid", None):
|
||||
podman_args.extend(["--pid", cnt["pid"]])
|
||||
pull_policy = cnt.get("pull_policy", None)
|
||||
if pull_policy is not None and pull_policy != "build":
|
||||
podman_args.extend(["--pull", pull_policy])
|
||||
|
@ -130,3 +130,25 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase):
|
||||
with self.assertRaises(TypeError):
|
||||
cnt["sysctls"] = wrong_type
|
||||
await container_to_args(c, cnt)
|
||||
|
||||
async def test_pid(self):
|
||||
c = create_compose_mock()
|
||||
cnt = get_minimal_container()
|
||||
|
||||
cnt["pid"] = "host"
|
||||
|
||||
args = await container_to_args(c, cnt)
|
||||
self.assertEqual(
|
||||
args,
|
||||
[
|
||||
"--name=project_name_service_name1",
|
||||
"-d",
|
||||
"--net",
|
||||
"",
|
||||
"--network-alias",
|
||||
"service_name",
|
||||
"--pid",
|
||||
"host",
|
||||
"busybox",
|
||||
],
|
||||
)
|
||||
|
6
tests/pid/docker-compose.yml
Normal file
6
tests/pid/docker-compose.yml
Normal file
@ -0,0 +1,6 @@
|
||||
version: "3"
|
||||
services:
|
||||
serv:
|
||||
image: busybox
|
||||
pid: host
|
||||
command: sh -c "ps all"
|
Loading…
Reference in New Issue
Block a user