summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2018-01-22 12:34:24 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-22 20:11:38 +0000
commit93765a99640940f59ce5827a6116ce5ccb1566f3 (patch)
treef517649fff54164c32fa63ac40027168bd4f1fd6 /libpod/container.go
parente1c67e6c8579931f44ec61f847f536a8f68202db (diff)
downloadpodman-93765a99640940f59ce5827a6116ce5ccb1566f3.tar.gz
podman-93765a99640940f59ce5827a6116ce5ccb1566f3.tar.bz2
podman-93765a99640940f59ce5827a6116ce5ccb1566f3.zip
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 <umohnani@redhat.com> Closes: #250 Approved by: rhatdan
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go24
1 files changed, 24 insertions, 0 deletions
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()
+}