From 393fa4b92f2ba6f3b3e2e17d33ab0243eef1d063 Mon Sep 17 00:00:00 2001 From: Jordan Christiansen Date: Wed, 23 Sep 2020 14:58:33 -0500 Subject: Allow filtering on pod label values Before this change, filters of the form `podman pod ps --filter label=app=myapp` were not working. The results would include all pods that contained the app label with any value. Looking at the code, this makes sense. It appears that the second = and everything after it were getting truncated. Even though there was already a passing test that tested `podman pod ps --filter label=io.podman.test.label=value1`, the test failed with the above example with a label `app=myapp`. The new code works in both cases. Signed-off-by: Jordan Christiansen --- test/e2e/pod_ps_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/e2e') diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go index d65bb33c7..17ed6a9c0 100644 --- a/test/e2e/pod_ps_test.go +++ b/test/e2e/pod_ps_test.go @@ -212,17 +212,17 @@ var _ = Describe("Podman ps", func() { Expect(ec).To(Equal(0)) _, ec, podid2 := podmanTest.CreatePodWithLabels("", map[string]string{ - "io.podman.test.label": "value1", - "io.podman.test.key": "irrelevant-value", + "app": "myapp", + "io.podman.test.key": "irrelevant-value", }) Expect(ec).To(Equal(0)) _, ec, podid3 := podmanTest.CreatePodWithLabels("", map[string]string{ - "io.podman.test.label": "value2", + "app": "test", }) Expect(ec).To(Equal(0)) - session := podmanTest.Podman([]string{"pod", "ps", "--no-trunc", "--filter", "label=io.podman.test.key", "--filter", "label=io.podman.test.label=value1"}) + session := podmanTest.Podman([]string{"pod", "ps", "--no-trunc", "--filter", "label=app", "--filter", "label=app=myapp"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(session.OutputToString()).To(Not(ContainSubstring(podid1))) -- cgit v1.2.3-54-g00ecf