Skip to content

Commit

Permalink
Merge pull request #783 from ChuJiani/devel
Browse files Browse the repository at this point in the history
Fix #782: add support for `http-proxy` option of podman
  • Loading branch information
p12tic committed Mar 9, 2024
2 parents 7987a71 + c98cbaa commit 43059dc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", []):
Expand Down
21 changes: 21 additions & 0 deletions pytests/test_container_to_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)

0 comments on commit 43059dc

Please sign in to comment.