Don't print rootfs and rw sizes if they're empty

We're printing them unconditionally now, even if --size is not
passed, which is confusing (you see a pair of 0s for container
size, when it is clearly not 0).

This may introduce bugs related to containers with an rwsize of 0
(freshly created from an image) and --size specified, but is
definitely better than what we have now.

Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
Matthew Heon 2018-07-13 11:25:05 -04:00
parent 4c44185199
commit f08fffa306
1 changed files with 2 additions and 2 deletions

View File

@ -63,8 +63,8 @@ type psJSONParams struct {
Status string `json:"status"`
PID int `json:"PID"`
Ports []ocicni.PortMapping `json:"ports"`
RootFsSize int64 `json:"rootFsSize"`
RWSize int64 `json:"rwSize"`
RootFsSize int64 `json:"rootFsSize,omitempty"`
RWSize int64 `json:"rwSize,omitempty"`
Names string `json:"names"`
Labels fields.Set `json:"labels"`
Mounts []string `json:"mounts"`