mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
Match output of Compat Top API to Docker
We were only splitting on tabs, not spaces, so we returned just a single line most of the time, not an array of the fields in the output of `ps`. Unfortunately, some of these fields are allowed to contain spaces themselves, which makes things complicated, but we got lucky in that Docker took the simplest possible solution and just assumed that only one field would contain spaces and it would always be the last one, which is easy enough to duplicate on our end. Fixes #23981 Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@ -144,6 +144,14 @@ if root; then
|
||||
podman rm -f $CTRNAME
|
||||
fi
|
||||
|
||||
# Verify that compat top endpoint combines multi-entry COMMAND lines
|
||||
CTRNAME=testtopproc
|
||||
podman run --name $CTRNAME -d $IMAGE sleep 25
|
||||
t GET containers/$CTRNAME/top?stream=false 200 \
|
||||
.Processes.[0].[6]="00:00:00" \
|
||||
.Processes.[0].[7]="sleep 25"
|
||||
podman rm -f -t0 $CTRNAME
|
||||
|
||||
CTRNAME=test123
|
||||
podman run --name $CTRNAME -d $IMAGE top
|
||||
t GET libpod/containers/$CTRNAME/top?ps_args=--invalid 500 \
|
||||
|
Reference in New Issue
Block a user