From 93765a99640940f59ce5827a6116ce5ccb1566f3 Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Mon, 22 Jan 2018 12:34:24 -0500 Subject: Fix issues with podman ps from QE QE pointed out a few things missing/wrong with ps This PR addresses those issues. Added functionality for getting mounts and size also Fixed a few issues with the --filter params, for example filter with partial information. Signed-off-by: umohnani8 Closes: #250 Approved by: rhatdan --- libpod/container.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'libpod/container.go') diff --git a/libpod/container.go b/libpod/container.go index 4170ea443..27042de39 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -515,3 +515,27 @@ func (c *Container) CGroupPath() cgroups.Path { func (c *Container) StopTimeout() uint { return c.config.StopTimeout } + +// RootFsSize returns the root FS size of the container +func (c *Container) RootFsSize() (int64, error) { + if !c.locked { + c.lock.Lock() + defer c.lock.Unlock() + if err := c.syncContainer(); err != nil { + return -1, errors.Wrapf(err, "error updating container %s state", c.ID()) + } + } + return c.rootFsSize() +} + +// RWSize returns the rw size of the container +func (c *Container) RWSize() (int64, error) { + if !c.locked { + c.lock.Lock() + defer c.lock.Unlock() + if err := c.syncContainer(); err != nil { + return -1, errors.Wrapf(err, "error updating container %s state", c.ID()) + } + } + return c.rwSize() +} -- cgit v1.2.3-54-g00ecf