Skip to content

Commit

Permalink
image list: do not reformat .CreatedAt
Browse files Browse the repository at this point in the history
As shown in containers#14456, the `.CreatedAt` fields for `image list` and of
`image history` can differ by one.  The discussed theory is that the
off-by-one is caused by rounding.

Indeed, the field of `image list` is reformatted.  `image history` is
returning the UNIX time; just as the `.CreatedAt` field should.

I am unable to create a reproducer for the issue but double-checked
what the docker client does: return the UNIX time.

[NO NEW TESTS NEEDED]

Fixes: containers#14456
Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Jun 3, 2022
1 parent f7a5408 commit 25168c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/podman/images/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func writeJSON(images []imageReporter) error {
var h image
h.ImageSummary = e.ImageSummary
h.Created = e.ImageSummary.Created
h.CreatedAt = e.created().Format(time.RFC3339Nano)
h.CreatedAt = e.created().String()
h.RepoTags = nil

imgs = append(imgs, h)
Expand Down

0 comments on commit 25168c5

Please sign in to comment.