Add --all,-a flag to podman images

podman images will not show intermediate images by default.
To view all images, including intermediate images created during
a build, use the --all flag.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #947
Approved by: rhatdan
This commit is contained in:
umohnani8
2018-06-14 14:53:59 -04:00
committed by Atomic Bot
parent 4d3db1b4a9
commit db094f6e15
6 changed files with 77 additions and 16 deletions

View File

@ -100,7 +100,7 @@ var _ = Describe("Podman images", func() {
It("podman images filter before image", func() {
dockerfile := `FROM docker.io/library/alpine:latest
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
result := podmanTest.Podman([]string{"images", "-q", "-f", "before=foobar.com/before:latest"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@ -114,7 +114,7 @@ var _ = Describe("Podman images", func() {
dockerfile := `FROM docker.io/library/alpine:latest
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
result := podmanTest.Podman([]string{"images", "-q", "-f", "after=docker.io/library/alpine:latest"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@ -124,8 +124,8 @@ var _ = Describe("Podman images", func() {
It("podman images filter dangling", func() {
dockerfile := `FROM docker.io/library/alpine:latest
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest")
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
result := podmanTest.Podman([]string{"images", "-q", "-f", "dangling=true"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@ -165,4 +165,22 @@ var _ = Describe("Podman images", func() {
return size1 < size2
})).To(BeTrue())
})
It("podman images --all flag", func() {
dockerfile := `FROM docker.io/library/alpine:latest
RUN mkdir hello
RUN touch test.txt
ENV foo=bar
`
podmanTest.BuildImage(dockerfile, "test", "true")
session := podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(Equal(4))
session2 := podmanTest.Podman([]string{"images", "--all"})
session2.WaitWithDefaultTimeout()
Expect(session2.ExitCode()).To(Equal(0))
Expect(len(session2.OutputToStringArray())).To(Equal(6))
})
})