Skip to content

Commit 4b3f94a

Browse files
rorybyrnebfirsh
authored andcommitted
feat: shell out to docker to get bridge IP
Signed-off-by: synek <rory@rory.bio>
1 parent 092d608 commit 4b3f94a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • end-to-end-test/end_to_end_test

end-to-end-test/end_to_end_test/util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,7 @@ def get_local_ip():
114114

115115
def get_bridge_ip():
116116
"""Return the IP address of the docker bridge network"""
117-
return "172.17.0.1"
117+
cmd = ["docker", "network", "inspect", "bridge", "--format='{{ json (index .IPAM.Config 0).Gateway }}'"]
118+
out, _ = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
119+
120+
return out.decode().strip().replace('"', "").replace("'", "")

0 commit comments

Comments
 (0)