Docker Compatibility API Timestamp Format #7860
Labels
Good First Issue
This issue would be a good issue for a first time contributor to undertake.
In Progress
This issue is actively being worked by the assignee, please do not work on this at this time.
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.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Docker compatibility endpoint /containers/id/json does not comply with the Docker API specification. The specs here show that the Created property is in ISO 8601 format. Podman on the other hand returns a string formatted differently (see below)
Line 318 in
podman/pkg/api/handlers/compat/containers.go
is the source of this behaviour:Created: l.CreatedTime().String(),
This would have to be changed to something like:
Created: l.CreatedTime().Format(time.RFC3339),
Steps to reproduce the issue:
Start the api as described: podman system service -t 5000 &
Call the api endpoint: curl -s --unix-socket $XDG_RUNTIME_DIR/podman/podman.sock http://dummy/containers/id/json (format with jq for readability)
Describe the results you received:
A string formatted with Time.String() :
"Created": "2020-09-27 17:01:55.178157437 +0000 UTC",
Describe the results you expected:
A string in ISO-8601:
"Created": "2020-09-27T17:01:55.178157437",
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: