Skip to content

Commit

Permalink
Don't use state.json from libcontainer to get cgroup paths.
Browse files Browse the repository at this point in the history
This confuses cadvisor on systems where cadvisor doesn't see cgroup mounts at the same place as root namespace view.
  • Loading branch information
rjnagal committed Dec 24, 2014
1 parent 7dc6032 commit 275b3ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion container/docker/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (self *dockerContainerHandler) GetStats() (stats *info.ContainerStats, err
return
}

stats, err = containerLibcontainer.GetStats(state)
stats, err = containerLibcontainer.GetStats(self.cgroupPaths, state)
if err != nil {
return
}
Expand Down
4 changes: 2 additions & 2 deletions container/libcontainer/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ var supportedSubsystems map[string]struct{} = map[string]struct{}{
}

// Get stats of the specified container
func GetStats(state *libcontainer.State) (*info.ContainerStats, error) {
func GetStats(cgroupPaths map[string]string, state *libcontainer.State) (*info.ContainerStats, error) {
// TODO(vmarmol): Use libcontainer's Stats() in the new API when that is ready.
stats := &libcontainer.ContainerStats{}

var err error
stats.CgroupStats, err = cgroupfs.GetStats(state.CgroupPaths)
stats.CgroupStats, err = cgroupfs.GetStats(cgroupPaths)
if err != nil {
return &info.ContainerStats{}, err
}
Expand Down
2 changes: 1 addition & 1 deletion container/raw/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) {
}
}

stats, err := libcontainer.GetStats(&state)
stats, err := libcontainer.GetStats(self.cgroupPaths, &state)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 275b3ed

Please sign in to comment.