mirror of
https://github.com/containers/podman.git
synced 2025-06-17 15:08:08 +08:00
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>
This commit is contained in:
@ -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"))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user