docker / cli

The Docker CLI
Apache License 2.0
4.77k stars 1.89k forks source link

formatters(image): prevent image size from displaying scientific notation #5059

Open servusdei2018 opened 2 months ago

servusdei2018 commented 2 months ago

fixes #3091 dupe #4459

- What I did

HumanSizeWithPrecision (which was configured to 3 significant digits) was replaced with HumanSize (which defaults to 4) in order to prevent scientific notation from appearing under certain edge cases. This is a known bug (docker/go-units#44) in the affected dependency.

In practical terms, adjusting the precision from 3 to 4 should cause no issues with users' current expectations and usage of the cli.

- How to verify it

Regression tests implemented to prevent future breakage.

- Description for the changelog

formatters(image): prevent image size from displaying scientific notation under edge cases
thaJeztah commented 2 months ago

I think this PR was pending to fix it in go-units, but there was some discussion on it and I don't recall exactly where we ended up;