Output headers for volume ls when empty

To have consistency with other podman commands like `ps` and `images`,
`volume ls` should output its headers even when there are no volumes.

Fixes: https://github.com/containers/podman/issues/25911

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2025-04-21 14:29:39 -05:00
parent b849550997
commit 71504eedfb
6 changed files with 16 additions and 16 deletions

View File

@@ -28,7 +28,7 @@ var _ = Describe("Podman volume rm", func() {
session = podmanTest.Podman([]string{"volume", "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session.OutputToStringArray()).To(BeEmpty())
Expect(session.OutputToStringArray()).To(HaveLen(1))
})
It("podman volume rm with --force flag", func() {
@@ -48,7 +48,7 @@ var _ = Describe("Podman volume rm", func() {
session = podmanTest.Podman([]string{"volume", "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session.OutputToStringArray()).To(BeEmpty())
Expect(session.OutputToStringArray()).To(HaveLen(1))
})
It("podman volume remove bogus", func() {
@@ -73,7 +73,7 @@ var _ = Describe("Podman volume rm", func() {
session = podmanTest.Podman([]string{"volume", "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session.OutputToStringArray()).To(BeEmpty())
Expect(session.OutputToStringArray()).To(HaveLen(1))
})
It("podman volume rm by partial name", func() {
@@ -88,7 +88,7 @@ var _ = Describe("Podman volume rm", func() {
session = podmanTest.Podman([]string{"volume", "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session.OutputToStringArray()).To(BeEmpty())
Expect(session.OutputToStringArray()).To(HaveLen(1))
})
It("podman volume rm by nonunique partial name", func() {