From a6a207673ec18f59613c39dda6b96bf68359552a Mon Sep 17 00:00:00 2001 From: Stefan Grundmann Date: Mon, 17 Jul 2023 17:01:12 +0000 Subject: [PATCH] libpod: fix FreeBSD 'podman-remote top' default behaviour use the 'pf -ef' compatible default when the descriptor argument of Top() is []string{""} or []string{} why: the call to Top() in pkg/api/handlers/compat/containers_top.go#L62C3-L62C3 passes []string{""} descriptors whenever ps_args is empty (the default value for libpod requests) because of golang strings.Split() semantics. [NO NEW TESTS NEEDED] Signed-off-by: Stefan Grundmann --- libpod/container_top_freebsd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpod/container_top_freebsd.go b/libpod/container_top_freebsd.go index 1a59a5d68f..8500e19b1c 100644 --- a/libpod/container_top_freebsd.go +++ b/libpod/container_top_freebsd.go @@ -43,7 +43,7 @@ func (c *Container) Top(descriptors []string) ([]string, error) { } // Default to 'ps -ef' compatible descriptors - if len(descriptors) == 0 { + if len(strings.Join(descriptors, "")) == 0 { descriptors = []string{"user", "pid", "ppid", "pcpu", "etime", "tty", "time", "args"} }