mirror of
https://github.com/containers/podman.git
synced 2025-09-08 18:52:20 +08:00
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 <sg2342@googlemail.com>
This commit is contained in:
@ -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"}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user