Skip to content

formatter: round CREATED durations consistently with Docker Desktop#6978

Open
texasich wants to merge 1 commit into
docker:masterfrom
texasich:6891-round-created-duration
Open

formatter: round CREATED durations consistently with Docker Desktop#6978
texasich wants to merge 1 commit into
docker:masterfrom
texasich:6891-round-created-duration

Conversation

@texasich
Copy link
Copy Markdown

@texasich texasich commented May 12, 2026

Summary

Why

Fixes inconsistency reported in #6891 where CLI CREATED values diverge from Docker Desktop due to flooring vs rounding behavior.

Scope notes

  • This PR only updates vendored go-units duration formatting used by CLI output
  • No command flags or API behavior changes

Validation

  • Targeted checks run for updated duration formatter and tests:
    • GO111MODULE=off go test ./vendor/github.com/docker/go-units -run TestHumanDuration -count=1
    • GO111MODULE=off go test ./vendor/github.com/docker/go-units -run ExampleHumanDuration -count=1

Fixes #6891

Sync vendored HumanDuration semantics with docker/go-units PR docker#51:
- add shared unit constants and roundDuration helper
- round day/week/month/year outputs consistently
- switch threshold checks to duration-based cutovers

Add vendored duration tests covering boundary transitions and expected
example outputs to guard against regressions in CREATED formatting.

Refs: docker#6891
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