Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Empty Networks list is treated as host network
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbranagan committed Oct 9, 2017
1 parent 3d5d9f2 commit 41dafea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down

0 comments on commit 41dafea

Please sign in to comment.