From 990514ea92b9b50dfb95dc0e505e11a21578a649 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Mon, 1 Jun 2020 09:43:45 -0500 Subject: 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 --- cmd/podman/pods/ps.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/podman/pods/ps.go') diff --git a/cmd/podman/pods/ps.go b/cmd/podman/pods/ps.go index 5703bd172..1385ff270 100644 --- a/cmd/podman/pods/ps.go +++ b/cmd/podman/pods/ps.go @@ -178,6 +178,11 @@ func (l ListPodReporter) Created() string { return units.HumanDuration(time.Since(l.ListPodsReport.Created)) + " ago" } +// Labels returns a map of the pod's labels +func (l ListPodReporter) Labels() map[string]string { + return l.ListPodsReport.Labels +} + // NumberofContainers returns an int representation for // the number of containers belonging to the pod func (l ListPodReporter) NumberOfContainers() int { -- cgit v1.2.3-54-g00ecf