diff --git a/docker-net-graph.py b/docker-net-graph.py index 44cabc9..bd00804 100755 --- a/docker-net-graph.py +++ b/docker-net-graph.py @@ -63,7 +63,7 @@ def get_networks(client: docker.DockerClient, verbose: bool) -> typing.Dict[str, for net in sorted(client.networks.list(), key=lambda k: k.name): try: - gateway = net.attrs["IPAM"]["Config"][0]["Gateway"] + gateway = net.attrs["IPAM"]["Config"][0]["Subnet"] except (KeyError, IndexError): # This network doesn't seem to be used, skip it continue diff --git a/test/docker-compose.yml b/test/docker-compose.yml index b555eba..e149f32 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -22,6 +22,7 @@ services: - network_a - network_b - network_c + - no_gateway host_service: container_name: host_service image: leoverto/dummy-image @@ -36,3 +37,11 @@ networks: network_b: network_c: empty_network: + no_gateway: + driver: bridge + driver_opts: + com.docker.network.bridge.name: br-no-gateway + ipam: + driver: default + config: + - subnet: 172.22.1.0/24