Send data for all interfaces for raw containers

This commit is contained in:
Victor Marmol 2015-06-08 09:58:34 -07:00
parent b923eff11c
commit 72df0cb098

View File

@ -305,15 +305,13 @@ func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error {
} }
func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) { func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) {
var networkInterfaces []string
nd, err := self.GetRootNetworkDevices() nd, err := self.GetRootNetworkDevices()
if err != nil { if err != nil {
return new(info.ContainerStats), err return new(info.ContainerStats), err
} }
if len(nd) != 0 { networkInterfaces := make([]string, len(nd))
// ContainerStats only reports stat for one network device. for i := range nd {
// TODO(rjnagal): Handle multiple physical network devices. networkInterfaces[i] = nd[i].Name
networkInterfaces = []string{nd[0].Name}
} }
stats, err := libcontainer.GetStats(self.cgroupManager, networkInterfaces) stats, err := libcontainer.GetStats(self.cgroupManager, networkInterfaces)
if err != nil { if err != nil {