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.
Closes:
Approved by: rhatdan
@@ -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()
+}
