mirror of
https://github.com/containers/podman.git
synced 2025-12-09 23:27:09 +08:00
podman ps command string too long
The default outout for podman ps should limit itself if the command is long. If the command is more than 20 characters, we truncate the command and add an elipses to it. Resolves: #464 Signed-off-by: baude <bbaude@redhat.com> Closes: #466 Approved by: rhatdan
This commit is contained in:
@@ -435,6 +435,11 @@ func getTemplateOutput(containers []*libpod.Container, opts psOptions) ([]psTemp
|
||||
}
|
||||
|
||||
command := strings.Join(batchInfo.conConfig.Spec.Process.Args, " ")
|
||||
if !opts.noTrunc {
|
||||
if len(command) > 20 {
|
||||
command = command[:19] + "..."
|
||||
}
|
||||
}
|
||||
ports := portsToString(batchInfo.conConfig.PortMappings)
|
||||
mounts := getMounts(createArtifact.Volumes, opts.noTrunc)
|
||||
labels := formatLabels(ctr.Labels())
|
||||
@@ -471,6 +476,7 @@ func getTemplateOutput(containers []*libpod.Container, opts psOptions) ([]psTemp
|
||||
Mounts: mounts,
|
||||
PID: batchInfo.pid,
|
||||
}
|
||||
|
||||
if opts.namespace {
|
||||
params.Cgroup = ns.Cgroup
|
||||
params.IPC = ns.IPC
|
||||
|
||||
Reference in New Issue
Block a user