summaryrefslogtreecommitdiff
path: root/cmd/podman/ps.go
diff options
context:
space:
mode:
authorNeville Cain <neville.cain@qonto.eu>2019-12-25 02:46:39 +0100
committerNeville Cain <neville.cain@qonto.eu>2019-12-28 00:03:57 +0100
commit8bc394ce6ec597f3c5bfb0fab5eb39b51afbe67d (patch)
tree1a1bbbbe88c70ee95e28746e413c6d26aff7dfa3 /cmd/podman/ps.go
parentc759c3f78dcbbf5dec462a863ad25cd41a1707b7 (diff)
downloadpodman-8bc394ce6ec597f3c5bfb0fab5eb39b51afbe67d.tar.gz
podman-8bc394ce6ec597f3c5bfb0fab5eb39b51afbe67d.tar.bz2
podman-8bc394ce6ec597f3c5bfb0fab5eb39b51afbe67d.zip
Add the pod name when we use `podman ps -p`
The pod name does not appear when doing `podman ps -p`. It is missing as the documentation says: -p, --pod Print the ID and name of the pod the containers are associated with The pod name is added in the ps output and checked in unit tests. Closes #4703 Signed-off-by: NevilleC <neville.cain@qonto.eu>
Diffstat (limited to 'cmd/podman/ps.go')
-rw-r--r--cmd/podman/ps.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 9fad0ea65..42d77a844 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -31,6 +31,7 @@ const (
hsize = "SIZE"
hinfra = "IS INFRA" //nolint
hpod = "POD"
+ hpodname = "POD NAME"
nspid = "PID"
nscgroup = "CGROUPNS"
nsipc = "IPC"
@@ -351,7 +352,7 @@ func psDisplay(c *cliconfig.PsValues, runtime *adapter.LocalRuntime) error {
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, himage, hcommand, hcreated, hstatus, hports, hnames)
// User wants pod info
if opts.Pod {
- fmt.Fprintf(w, "\t%s", hpod)
+ fmt.Fprintf(w, "\t%s\t%s", hpod, hpodname)
}
//User wants size info
if opts.Size {
@@ -370,7 +371,7 @@ func psDisplay(c *cliconfig.PsValues, runtime *adapter.LocalRuntime) error {
fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s", container.ID, container.Image, container.Command, container.Created, container.Status, container.Ports, container.Names)
// User wants pod info
if opts.Pod {
- fmt.Fprintf(w, "\t%s", container.Pod)
+ fmt.Fprintf(w, "\t%s\t%s", container.Pod, container.PodName)
}
//User wants size info
if opts.Size {