Skip to content

Commit

Permalink
Fix network info for docker containers running with --net=host.
Browse files Browse the repository at this point in the history
Docker still reports a loop device for these. Need to check for
more than one device to mark network as available.
  • Loading branch information
rjnagal committed Aug 21, 2015
1 parent 374e36d commit 2da1f25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion container/docker/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ func libcontainerConfigToContainerSpec(config *libcontainerConfigs.Config, mi *i
}
spec.Cpu.Mask = utils.FixCpuMask(config.Cgroups.CpusetCpus, mi.NumCores)

spec.HasNetwork = len(config.Networks) > 0
// Docker reports a loop device for containers with --net=host. Ignore
// those too.
spec.HasNetwork = len(config.Networks) > 1
spec.HasDiskIo = true

return spec
Expand Down

0 comments on commit 2da1f25

Please sign in to comment.