mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
filter: add basic pattern matching for label keys
Following PR adds basic pattern matching to filter by labels for `keys`. Adds support for use-cases like `--filter label=some.prefix.com/key/*` where end-users want to match a pattern for keys as compared to exact value. Signed-off-by: Aditya Rajan <arajan@redhat.com>
This commit is contained in:
@ -45,6 +45,17 @@ var _ = Describe("Podman volume ls", func() {
|
||||
Expect(len(session.OutputToStringArray())).To(Equal(2))
|
||||
})
|
||||
|
||||
It("podman ls volume filter with a key pattern", func() {
|
||||
session := podmanTest.Podman([]string{"volume", "create", "--label", "helloworld=world", "myvol2"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"volume", "ls", "--filter", "label=hello*"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(len(session.OutputToStringArray())).To(Equal(2))
|
||||
})
|
||||
|
||||
It("podman ls volume with JSON format", func() {
|
||||
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
Reference in New Issue
Block a user