Merge pull request #783 from ChuJiani/devel

Fix #782: add support for `http-proxy` option of podman
This commit is contained in:
Povilas Kanapickas 2024-03-09 23:27:22 +02:00 committed by GitHub
commit 43059dc16f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View File

@ -889,6 +889,8 @@ async def container_to_args(compose, cnt, detached=True):
podman_args.extend(["--annotation", a]) podman_args.extend(["--annotation", a])
if cnt.get("read_only", None): if cnt.get("read_only", None):
podman_args.append("--read-only") 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", []): for i in cnt.get("labels", []):
podman_args.extend(["--label", i]) podman_args.extend(["--label", i])
for c in cnt.get("cap_add", []): for c in cnt.get("cap_add", []):

View File

@ -152,3 +152,24 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase):
"busybox", "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",
],
)