podman socket API top returns Titles as single string instead of array of strings #17524
Labels
Good First Issue
This issue would be a good issue for a first time contributor to undertake.
HTTP API
Bug is in RESTful API
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Issue Description
I'm using RHEL 9.1 and podman 4.2.0 with crun 1.5.
I was trying to get a container functional with is based on newrelic infrastructure agent.
The agent was tested with docker initially, but I wanted to test it using podman.
As the container requires the docker socket to be mounted into the container I started the podman.socket.
However I noticed that there were errors regarding querying container processes using the
docker top
from within the container.That is the container queries the REST API of the podman.socket for processes.
Curious on what why this is failing I investigated the podman REST endpoint and found that the GET request documented here:
https://docs.podman.io/en/latest/_static/api.html#tag/containers-(compat)/operation/ContainerList
behaves different for the "Titles" field in the response.
This should be an array of strings, however using:
curl --silent -XGET --unix-socket $XDG_RUNTIME_DIR/podman/podman.sock -H 'Content-Type: application/json' http://localhost/containers/321be6b5b7264ee5dfe651fe78355c3ce450c3167f245136bcf5cb66ae9107fe/top
delivers ONE string for "Titles":
{... ,"Titles":["PID USER TIME COMMAND"]}
However this is ONE string and not an array as stated in the documentation.
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
The "Titles" from the response is:
{... ,"Titles":["PID USER TIME COMMAND"]}
Describe the results you expected
The "Titles" field should be:
"Titles":["PID", "USER", "TIME", "COMMAND"]}
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: