Skip to content

formatter: round human durations for CREATED columns - #7179

Open
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix/human-duration-rounding
Open

formatter: round human durations for CREATED columns#7179
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix/human-duration-rounding

Conversation

@locker95

Copy link
Copy Markdown

docker image ls / ps CREATED text could disagree with Docker Desktop for mid-range ages (e.g. ~4 days showing as 3) because go-units floors day/week units.

Added internal/duration.HumanDuration with round-half-up at day/week/month/year boundaries and switched the CREATED-style formatters over. Avoids hand-editing vendor copies of go-units.

Fixes #6891

CLI CREATED fields used go-units HumanDuration, which floors day/week
values while Docker Desktop rounds. Localize a small HumanDuration with
consistent round-half-up so image/container listings match Desktop more
closely without vendoring frozen go-units changes.

Fixes docker#6891

Signed-off-by: Dean Chen <862469039@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent "CREATED" values between CLI and Docker Desktop

1 participant