Skip to content

Commit

Permalink
Merge pull request #7568 from rhatdan/latest
Browse files Browse the repository at this point in the history
Fix podman ps -l
  • Loading branch information
openshift-merge-robot authored Sep 9, 2020
2 parents 1b2b068 + 3a7faf7 commit 21cfcc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/domain/infra/abi/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri
}

func (ic *ContainerEngine) ContainerList(ctx context.Context, options entities.ContainerListOptions) ([]entities.ListContainer, error) {
if options.Latest {
options.Last = 1
}
return ps.GetContainerLists(ic.Libpod, options)
}

Expand Down
6 changes: 4 additions & 2 deletions test/e2e/ps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ var _ = Describe("Podman ps", func() {
SkipIfRemote()
_, ec, _ := podmanTest.RunLsContainer("")
Expect(ec).To(Equal(0))
_, ec, _ = podmanTest.RunLsContainer("")
Expect(ec).To(Equal(0))

result := podmanTest.Podman([]string{"ps", "--latest"})
result := podmanTest.Podman([]string{"ps", "-q", "--latest"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
Expect(len(result.OutputToStringArray())).Should(BeNumerically(">", 0))
Expect(len(result.OutputToStringArray())).Should(Equal(1))
})

It("podman ps last flag", func() {
Expand Down

0 comments on commit 21cfcc4

Please sign in to comment.