libpod: Fix "top" support on FreeBSD

FreeBSD's ps ignores -J if -a is specified, so "podman top" would
effectively just run ps -a, not terribly useful.  But there's no need to
specify -a when specifying a selector such as -J (or -G or -U, etc.).

Signed-off-by: Mark Johnston <mark.johnston@klarasystems.com>
This commit is contained in:
Mark Johnston
2025-08-26 15:47:34 +00:00
parent 5ba23ccad5
commit a250fee0ec

View File

@ -57,7 +57,7 @@ func (c *Container) Top(descriptors []string) ([]string, error) {
}
}
if supportedDescriptors {
descriptors = []string{"-ao", strings.Join(descriptors, ",")}
descriptors = []string{"-o", strings.Join(descriptors, ",")}
}
// Note that the descriptors to ps(1) must be shlexed (see #12452).