mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
@ -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) {
|
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)
|
return ps.GetContainerLists(ic.Libpod, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,11 +104,13 @@ var _ = Describe("Podman ps", func() {
|
|||||||
SkipIfRemote()
|
SkipIfRemote()
|
||||||
_, ec, _ := podmanTest.RunLsContainer("")
|
_, ec, _ := podmanTest.RunLsContainer("")
|
||||||
Expect(ec).To(Equal(0))
|
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()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result.ExitCode()).To(Equal(0))
|
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() {
|
It("podman ps last flag", func() {
|
||||||
|
Reference in New Issue
Block a user