Skip to content

Commit 4d4aed7

Browse files
committed
Merge pull request #395 from rjnagal/docker
Don't use state.json from libcontainer to get cgroup paths.
2 parents 7dc6032 + 275b3ed commit 4d4aed7

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

container/docker/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func (self *dockerContainerHandler) GetStats() (stats *info.ContainerStats, err
295295
return
296296
}
297297

298-
stats, err = containerLibcontainer.GetStats(state)
298+
stats, err = containerLibcontainer.GetStats(self.cgroupPaths, state)
299299
if err != nil {
300300
return
301301
}

container/libcontainer/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ var supportedSubsystems map[string]struct{} = map[string]struct{}{
7373
}
7474

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

8080
var err error
81-
stats.CgroupStats, err = cgroupfs.GetStats(state.CgroupPaths)
81+
stats.CgroupStats, err = cgroupfs.GetStats(cgroupPaths)
8282
if err != nil {
8383
return &info.ContainerStats{}, err
8484
}

container/raw/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) {
273273
}
274274
}
275275

276-
stats, err := libcontainer.GetStats(&state)
276+
stats, err := libcontainer.GetStats(self.cgroupPaths, &state)
277277
if err != nil {
278278
return nil, err
279279
}

0 commit comments

Comments
 (0)