From 41dafea71c7820a9a189e773b01d661ce726f84b Mon Sep 17 00:00:00 2001 From: Conor Branagan Date: Mon, 9 Oct 2017 00:02:52 -0400 Subject: [PATCH] Empty Networks list is treated as host network --- util/docker/docker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/docker/docker.go b/util/docker/docker.go index 360644bee..0943c1636 100644 --- a/util/docker/docker.go +++ b/util/docker/docker.go @@ -562,7 +562,7 @@ var hostNetwork = dockerNetwork{"eth0", "bridge"} func findDockerNetworks(containerID string, pid int, netSettings *types.SummaryNetworkSettings) []dockerNetwork { // Verify that we aren't using an older version of Docker that does // not provider the network settings in container inspect. - if netSettings == nil || netSettings.Networks == nil { + if netSettings == nil || netSettings.Networks == nil || len(netSettings.Networks) == 0 { log.Debugf("No network settings available from docker, defaulting to host network") return []dockerNetwork{hostNetwork} }