1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-02-24 01:38:15 +00:00

fix: Don't connect pytest container to networks when using host network

This is not compatible or required, since host networking is no longer isolated to container networks only.
This commit is contained in:
polarathene 2021-12-31 22:14:26 +13:00
parent b2b4c71997
commit 0e5d97a268

View File

@ -362,6 +362,10 @@ def connect_to_network(network):
# figure out our container networks
my_networks = list(my_container.attrs["NetworkSettings"]["Networks"].keys())
# If the pytest container is using host networking, it cannot connect to container networks (not required with host network)
if 'host' in my_networks:
return None
# make sure our container is connected to the nginx-proxy's network
if network not in my_networks:
logging.info(f"Connecting to docker network: {network.name}")