mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Make volume filters inclusive
When using multiple filters, return a volume that matches any one of the used filters, rather than matching both of the filters. This is for compatibility with docker's cli, and more importantly, the apiv2 compat endpoint Closes #6765 Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
@ -110,4 +110,27 @@ var _ = Describe("Podman volume ls", func() {
|
||||
Expect(lsDangling.ExitCode()).To(Equal(0))
|
||||
Expect(lsDangling.OutputToString()).To(ContainSubstring(volName1))
|
||||
})
|
||||
It("podman ls volume with multiple --filter flag", func() {
|
||||
session := podmanTest.Podman([]string{"volume", "create", "--label", "foo=bar", "myvol"})
|
||||
volName := session.OutputToString()
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"volume", "create", "--label", "foo2=bar2", "anothervol"})
|
||||
anotherVol := session.OutputToString()
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"volume", "create"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"volume", "ls", "--filter", "label=foo", "--filter", "label=foo2"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(len(session.OutputToStringArray())).To(Equal(3))
|
||||
Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName))
|
||||
Expect(session.OutputToStringArray()[2]).To(ContainSubstring(anotherVol))
|
||||
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user