mirror of
https://github.com/containers/podman.git
synced 2025-06-29 06:57:13 +08:00
podman-remote make --size optional in ps
Close #3578 Add `size` field to PsOpts in podman remote to receive size as an option. Signed-off-by: Qi Wang <qiwan@redhat.com>
This commit is contained in:
2
API.md
2
API.md
@ -1894,6 +1894,8 @@ pod [?bool](#?bool)
|
|||||||
|
|
||||||
quiet [?bool](#?bool)
|
quiet [?bool](#?bool)
|
||||||
|
|
||||||
|
size [?bool](#?bool)
|
||||||
|
|
||||||
sort [?string](#?string)
|
sort [?string](#?string)
|
||||||
|
|
||||||
sync [?bool](#?bool)
|
sync [?bool](#?bool)
|
||||||
|
@ -146,6 +146,7 @@ type PsOpts (
|
|||||||
noTrunc: ?bool,
|
noTrunc: ?bool,
|
||||||
pod: ?bool,
|
pod: ?bool,
|
||||||
quiet: ?bool,
|
quiet: ?bool,
|
||||||
|
size: ?bool,
|
||||||
sort: ?string,
|
sort: ?string,
|
||||||
sync: ?bool
|
sync: ?bool
|
||||||
)
|
)
|
||||||
|
@ -493,6 +493,7 @@ func (r *LocalRuntime) Ps(c *cliconfig.PsValues, opts shared.PsOptions) ([]share
|
|||||||
NoTrunc: &c.NoTrunct,
|
NoTrunc: &c.NoTrunct,
|
||||||
Pod: &c.Pod,
|
Pod: &c.Pod,
|
||||||
Quiet: &c.Quiet,
|
Quiet: &c.Quiet,
|
||||||
|
Size: &c.Size,
|
||||||
Sort: &c.Sort,
|
Sort: &c.Sort,
|
||||||
Sync: &c.Sync,
|
Sync: &c.Sync,
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,6 @@ func (i *LibpodAPI) Ps(call iopodman.VarlinkCall, opts iopodman.PsOpts) error {
|
|||||||
Status: ctr.Status,
|
Status: ctr.Status,
|
||||||
State: ctr.State.String(),
|
State: ctr.State.String(),
|
||||||
PidNum: int64(ctr.Pid),
|
PidNum: int64(ctr.Pid),
|
||||||
RootFsSize: ctr.Size.RootFsSize,
|
|
||||||
RwSize: ctr.Size.RwSize,
|
|
||||||
Pod: ctr.Pod,
|
Pod: ctr.Pod,
|
||||||
CreatedAt: ctr.CreatedAt.Format(time.RFC3339Nano),
|
CreatedAt: ctr.CreatedAt.Format(time.RFC3339Nano),
|
||||||
ExitedAt: ctr.ExitedAt.Format(time.RFC3339Nano),
|
ExitedAt: ctr.ExitedAt.Format(time.RFC3339Nano),
|
||||||
@ -93,6 +91,10 @@ func (i *LibpodAPI) Ps(call iopodman.VarlinkCall, opts iopodman.PsOpts) error {
|
|||||||
Uts: ctr.UTS,
|
Uts: ctr.UTS,
|
||||||
Mounts: ctr.Mounts,
|
Mounts: ctr.Mounts,
|
||||||
}
|
}
|
||||||
|
if ctr.Size != nil {
|
||||||
|
container.RootFsSize = ctr.Size.RootFsSize
|
||||||
|
container.RwSize = ctr.Size.RwSize
|
||||||
|
}
|
||||||
containers = append(containers, container)
|
containers = append(containers, container)
|
||||||
}
|
}
|
||||||
return call.ReplyPs(containers)
|
return call.ReplyPs(containers)
|
||||||
|
@ -191,7 +191,7 @@ func makePsOpts(inOpts iopodman.PsOpts) shared.PsOptions {
|
|||||||
Latest: derefBool(inOpts.Latest),
|
Latest: derefBool(inOpts.Latest),
|
||||||
NoTrunc: derefBool(inOpts.NoTrunc),
|
NoTrunc: derefBool(inOpts.NoTrunc),
|
||||||
Pod: derefBool(inOpts.Pod),
|
Pod: derefBool(inOpts.Pod),
|
||||||
Size: true,
|
Size: derefBool(inOpts.Size),
|
||||||
Sort: derefString(inOpts.Sort),
|
Sort: derefString(inOpts.Sort),
|
||||||
Namespace: true,
|
Namespace: true,
|
||||||
Sync: derefBool(inOpts.Sync),
|
Sync: derefBool(inOpts.Sync),
|
||||||
|
Reference in New Issue
Block a user