fix ps --last=N

Fix `ps --last=N` to also include non-running containers. Also add an
e2e test to prevent us from regressing in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2020-05-28 14:24:01 +02:00
parent adca437d03
commit d6469c9c9b
2 changed files with 24 additions and 3 deletions

View File

@ -23,7 +23,7 @@ func GetContainerLists(runtime *libpod.Runtime, options entities.ContainerListOp
filterFuncs []libpod.ContainerFilter
pss []entities.ListContainer
)
all := options.All
all := options.All || options.Last > 0
if len(options.Filters) > 0 {
for k, v := range options.Filters {
for _, val := range v {