Commit Graph

4 Commits (e71113cffd7179bba6926c307f19ad8a4a8c7f74)

Author SHA1 Message Date
Jason Wilder 90c6c3ef3e Fix panic in CgroupCPU
If an invalid container ID is passed to CgroupCPU,
a panic can result.
Jason Wilder 812b04d363 Don't ignore err when getting CgroupMemDocker stats
Fixes panic: runtime error: index out of range

goroutine 10 [running]:
testing.func·006()
	/usr/local/go/src/testing/testing.go:441 +0x181
github.com/shirou/gopsutil/docker.CgroupMem(0x586b30, 0x6, 0x5a87d0, 0x1c, 0x0, 0x0, 0x0)
	/home/jwilder/go/src/github.com/shirou/gopsutil/docker/docker_linux.go:119 +0xf48
github.com/shirou/gopsutil/docker.CgroupMemDocker(0x586b30, 0x6, 0x0, 0x0, 0x0)
	/home/jwilder/go/src/github.com/shirou/gopsutil/docker/docker_linux.go:184 +0x57

If the ID passed to the CGroupMemDocker does not exist, you can get
a panic at runtime.  This can happen when a container exits before
calling the func.
Shirou WAKAYAMA 13cd195a7e change package name.
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24