-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'podman ps --format json' no longer has a numeric UNIX timestamp in "Created" #9315
Comments
Changed in 2d861ac, which modified the output format as well as the internal representation. |
@rhatdan PTAL |
@afbjorklund did you intend to have the output format modified as well? |
when printing out json format, we mistakenly changed the Created field output to be a time.time in a different commit. This allows for override of the Created field to be a unix ts as type int64. Fixes: containers#9315 Signed-off-by: baude <[email protected]>
It was not me (but rhatdan) - just digged it up in log, and it looked unintentional Should be straightforward to make it more similar to the images list, I think ?
But you seem to be having something else going on there already |
The goal was to be more precise then just Unix() which returns EPOCH Seconds. As I recall there were tests that we sorting two containers, that we definitely created one after the other, but created in the same second. So sorting them would randomly put one before the other. Getting to more precision eliminated this problem. |
Yay! Thanks for the fix. |
Oops, on closer inspection, I see that #9320 changed Toolbox doesn't use the |
If the number of seconds is well in the future then it is nanoseconds. |
Well, one way to tell them apart is to take the timestamp value of the present moment and compare it with the number in the JSON. If the JSON value is higher then we could say that it's in nano seconds, because What I am not sure about is, how robust this will be against weird pathological cases like broken clocks and such. |
when printing out json format, we mistakenly changed the Created field output to be a time.time in a different commit. This allows for override of the Created field to be a unix ts as type int64. Fixes: containers#9315 Signed-off-by: baude <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
podman ps --format json
no longer has a numeric UNIX timestamp inCreated
. In the release candidates for Podman 3.0.0, it's a string that looks like"2021-01-19T19:17:40.179387486+01:00"
. Earlier, in Podman 2.2.1, it used to be a number that would get parsed as afloat64
.Note that:
podman images --format json
continues to have a numeric UNIX timestamp inCreated
, and this particular encoding for containers was discussed during the Podman 2.x timeframe in Json output of podman ps lacks a human-readable time of creation #6594.Toolbox doesn't use the
CreatedAt
fields. So this string representation inpodman ps
can be moved toCreatedAt
because that will make it consistent withpodman images
.Steps to reproduce the issue:
$ podman ps --all --format json | less
Describe the results you received:
Created
is a string.Describe the results you expected:
Created
should've been a numeric UNIX timestamp.Additional information you deem important (e.g. issue happens only occasionally):
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
The text was updated successfully, but these errors were encountered: