Skip to content

Commit

Permalink
fix for docker 17.04 list networks API change
Browse files Browse the repository at this point in the history
  • Loading branch information
codekitchen committed Apr 10, 2017
1 parent b3b7806 commit ae54464
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions join-networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ func getActiveBridgeNetworks(client *docker.Client, containerName string) (netwo
panic(err)
}

for _, net := range allNetworks {
if net.Driver == "bridge" {
for _, netOverview := range allNetworks {
if netOverview.Driver == "bridge" {
// grab the network details (including the list of containers)
net, err := client.NetworkInfo(netOverview.ID)
if err != nil {
panic(err)
}
_, containsSelf := net.Containers[containerName]
if net.Options["com.docker.network.bridge.default_bridge"] == "true" ||
len(net.Containers) > 1 ||
Expand Down

0 comments on commit ae54464

Please sign in to comment.