summaryrefslogtreecommitdiff
path: root/libpod/container_top_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_top_linux.go')
-rw-r--r--libpod/container_top_linux.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/container_top_linux.go b/libpod/container_top_linux.go
index ce471838d..5f4f28130 100644
--- a/libpod/container_top_linux.go
+++ b/libpod/container_top_linux.go
@@ -15,6 +15,10 @@ import (
// Top gathers statistics about the running processes in a container. It returns a
// []string for output
func (c *Container) Top(descriptors []string) ([]string, error) {
+ if c.config.NoCgroups {
+ return nil, errors.Wrapf(define.ErrNoCgroups, "cannot run top on container %s as it did not create a cgroup", c.ID())
+ }
+
conStat, err := c.State()
if err != nil {
return nil, errors.Wrapf(err, "unable to look up state for %s", c.ID())