summaryrefslogtreecommitdiff
path: root/test/e2e/pod_ps_test.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-06-01 09:43:45 -0500
committerBrent Baude <bbaude@redhat.com>2020-06-01 11:54:15 -0500
commit990514ea92b9b50dfb95dc0e505e11a21578a649 (patch)
tree8ba9db4d111bd7379ac09780533d304154b69658 /test/e2e/pod_ps_test.go
parentf559cec6c0d1694cca9530004aaba3c138f621e3 (diff)
downloadpodman-990514ea92b9b50dfb95dc0e505e11a21578a649.tar.gz
podman-990514ea92b9b50dfb95dc0e505e11a21578a649.tar.bz2
podman-990514ea92b9b50dfb95dc0e505e11a21578a649.zip
Add support for format {{.Label}}
the pod ps man page says .Label is valid go template format. i dont think the function was actually ever implemented. Fixes #6448 Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/pod_ps_test.go')
-rw-r--r--test/e2e/pod_ps_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index 81d97b72d..8dcaf6af1 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -243,4 +243,20 @@ var _ = Describe("Podman ps", func() {
infra.WaitWithDefaultTimeout()
Expect(len(infra.OutputToString())).To(BeZero())
})
+
+ It("podman pod ps format with labels", func() {
+ _, ec, _ := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
+
+ _, ec1, _ := podmanTest.CreatePodWithLabels("", map[string]string{
+ "io.podman.test.label": "value1",
+ "io.podman.test.key": "irrelevant-value",
+ })
+ Expect(ec1).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"pod", "ps", "--format", "{{.Labels}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("value1"))
+ })
})