diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-02-12 17:06:53 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-02-12 20:14:20 -0500 |
commit | d2100cd47359ef0afa1a25f6f3a6a7708cd855f7 (patch) | |
tree | a6af1821b09d5bf7b5511813ec6214c79f13f7b4 /cmd/podman | |
parent | 2281cbdd6d5b1b7bca99a605ffc8625b6bee7eb3 (diff) | |
download | podman-d2100cd47359ef0afa1a25f6f3a6a7708cd855f7.tar.gz podman-d2100cd47359ef0afa1a25f6f3a6a7708cd855f7.tar.bz2 podman-d2100cd47359ef0afa1a25f6f3a6a7708cd855f7.zip |
Only set --all when a status filter is given to ps
The changes in #5075 turn out to be too aggressive; we should
only be setting --all if a status= filter is given. Otherwise
only running containers are filtered.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/ps.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go index d93ccc24c..accd5b51a 100644 --- a/cmd/podman/ps.go +++ b/cmd/podman/ps.go @@ -205,9 +205,15 @@ func checkFlagsPassed(c *cliconfig.PsValues) error { if c.Last >= 0 && c.Latest { return errors.Errorf("last and latest are mutually exclusive") } - // Filter forces all + // Filter on status forces all if len(c.Filter) > 0 { - c.All = true + for _, filter := range c.Filter { + splitFilter := strings.SplitN(filter, "=", 2) + if strings.ToLower(splitFilter[0]) == "status" { + c.All = true + break + } + } } // Quiet conflicts with size and namespace and is overridden by a Go // template. |