mirror of
https://github.com/containers/podman.git
synced 2025-06-28 22:53:21 +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)
|
||||||
|
@ -144,10 +144,11 @@ type PsOpts (
|
|||||||
last: ?int,
|
last: ?int,
|
||||||
latest: ?bool,
|
latest: ?bool,
|
||||||
noTrunc: ?bool,
|
noTrunc: ?bool,
|
||||||
pod: ?bool,
|
pod: ?bool,
|
||||||
quiet: ?bool,
|
quiet: ?bool,
|
||||||
sort: ?string,
|
size: ?bool,
|
||||||
sync: ?bool
|
sort: ?string,
|
||||||
|
sync: ?bool
|
||||||
)
|
)
|
||||||
|
|
||||||
type PsContainer (
|
type PsContainer (
|
||||||
|
@ -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,
|
||||||
}
|
}
|
||||||
|
@ -66,32 +66,34 @@ func (i *LibpodAPI) Ps(call iopodman.VarlinkCall, opts iopodman.PsOpts) error {
|
|||||||
|
|
||||||
for _, ctr := range psContainerOutputs {
|
for _, ctr := range psContainerOutputs {
|
||||||
container := iopodman.PsContainer{
|
container := iopodman.PsContainer{
|
||||||
Id: ctr.ID,
|
Id: ctr.ID,
|
||||||
Image: ctr.Image,
|
Image: ctr.Image,
|
||||||
Command: ctr.Command,
|
Command: ctr.Command,
|
||||||
Created: ctr.Created,
|
Created: ctr.Created,
|
||||||
Ports: ctr.Ports,
|
Ports: ctr.Ports,
|
||||||
Names: ctr.Names,
|
Names: ctr.Names,
|
||||||
IsInfra: ctr.IsInfra,
|
IsInfra: ctr.IsInfra,
|
||||||
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,
|
Pod: ctr.Pod,
|
||||||
RwSize: ctr.Size.RwSize,
|
CreatedAt: ctr.CreatedAt.Format(time.RFC3339Nano),
|
||||||
Pod: ctr.Pod,
|
ExitedAt: ctr.ExitedAt.Format(time.RFC3339Nano),
|
||||||
CreatedAt: ctr.CreatedAt.Format(time.RFC3339Nano),
|
StartedAt: ctr.StartedAt.Format(time.RFC3339Nano),
|
||||||
ExitedAt: ctr.ExitedAt.Format(time.RFC3339Nano),
|
Labels: ctr.Labels,
|
||||||
StartedAt: ctr.StartedAt.Format(time.RFC3339Nano),
|
NsPid: ctr.PID,
|
||||||
Labels: ctr.Labels,
|
Cgroup: ctr.Cgroup,
|
||||||
NsPid: ctr.PID,
|
Ipc: ctr.Cgroup,
|
||||||
Cgroup: ctr.Cgroup,
|
Mnt: ctr.MNT,
|
||||||
Ipc: ctr.Cgroup,
|
Net: ctr.NET,
|
||||||
Mnt: ctr.MNT,
|
PidNs: ctr.PIDNS,
|
||||||
Net: ctr.NET,
|
User: ctr.User,
|
||||||
PidNs: ctr.PIDNS,
|
Uts: ctr.UTS,
|
||||||
User: ctr.User,
|
Mounts: ctr.Mounts,
|
||||||
Uts: ctr.UTS,
|
}
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
@ -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