Fix managed ingress loopback publication

This commit is contained in:
2026-08-03 19:28:10 +02:00
parent eb04804d36
commit 909862afdb
3 changed files with 43 additions and 2 deletions
+19
View File
@@ -60,6 +60,25 @@ class ManagedIngressDrillTests(unittest.TestCase):
self.assertNotIn("type=bind", source)
self.assertIn('"--network-alias",\n "load-balancer"', source)
self.assertNotIn('"127.0.0.1::8080"', source)
self.assertIn("requested_http_port", source)
self.assertIn("requested_https_port", source)
def test_published_port_reads_the_docker_mapping(self) -> None:
completed = subprocess.CompletedProcess(
[],
0,
"127.0.0.1:49152\n",
"",
)
with patch.object(INGRESS, "_run", return_value=completed) as run:
port = INGRESS._published_port("ingress", 8443)
self.assertEqual(49152, port)
self.assertEqual(
["docker", "port", "ingress", "8443/tcp"],
run.call_args.args[0],
)
if __name__ == "__main__":