From c98cbaaaf046699835a1d15f1df167b056d1eb92 Mon Sep 17 00:00:00 2001 From: ChuJiani Date: Sat, 9 Mar 2024 17:10:09 +0000 Subject: [PATCH] Fix #782: add support for http_proxy Signed-off-by: ChuJiani --- podman_compose.py | 2 ++ pytests/test_container_to_args.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/podman_compose.py b/podman_compose.py index 702a5d6e..8166f7c3 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -889,6 +889,8 @@ async def container_to_args(compose, cnt, detached=True): podman_args.extend(["--annotation", a]) if cnt.get("read_only", None): podman_args.append("--read-only") + if cnt.get("http_proxy", None) is False: + podman_args.append("--http-proxy=false") for i in cnt.get("labels", []): podman_args.extend(["--label", i]) for c in cnt.get("cap_add", []): diff --git a/pytests/test_container_to_args.py b/pytests/test_container_to_args.py index 1146c3d5..840ae703 100644 --- a/pytests/test_container_to_args.py +++ b/pytests/test_container_to_args.py @@ -152,3 +152,24 @@ async def test_pid(self): "busybox", ], ) + + async def test_http_proxy(self): + c = create_compose_mock() + + cnt = get_minimal_container() + cnt["http_proxy"] = False + + args = await container_to_args(c, cnt) + self.assertEqual( + args, + [ + "--name=project_name_service_name1", + "-d", + "--http-proxy=false", + "--net", + "", + "--network-alias", + "service_name", + "busybox", + ], + )