summaryrefslogtreecommitdiff
path: root/cmd/podman/ps.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/ps.go')
-rw-r--r--cmd/podman/ps.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 9fad0ea65..d2c5e19e2 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"
@@ -204,11 +205,15 @@ func checkFlagsPassed(c *cliconfig.PsValues) error {
if c.Last >= 0 && c.Latest {
return errors.Errorf("last and latest are mutually exclusive")
}
- // Quiet conflicts with size, namespace, and format with a Go template
+ // Quiet conflicts with size and namespace and is overridden by a Go
+ // template.
if c.Quiet {
- if c.Size || c.Namespace || (c.Flag("format").Changed &&
- c.Format != formats.JSONString) {
- return errors.Errorf("quiet conflicts with size, namespace, and format with go template")
+ if c.Size || c.Namespace {
+ return errors.Errorf("quiet conflicts with size and namespace")
+ }
+ if c.Flag("format").Changed && c.Format != formats.JSONString {
+ // Quiet is overridden by Go template output.
+ c.Quiet = false
}
}
// Size and namespace conflict with each other
@@ -351,7 +356,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 +375,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 {