fix: correct memory unit formatting in dashboard#821
Merged
sudermanjr merged 1 commit intoFairwindsOps:masterfrom Jan 21, 2026
Merged
fix: correct memory unit formatting in dashboard#821sudermanjr merged 1 commit intoFairwindsOps:masterfrom
sudermanjr merged 1 commit intoFairwindsOps:masterfrom
Conversation
aa2f069 to
066a2e2
Compare
Member
|
Very cool, thanks! Looks like a few other tests might need to be updated |
Signed-off-by: Clément LEFEVRE <[email protected]>
066a2e2 to
7345690
Compare
Contributor
Author
|
Hi @sudermanjr, thanks, I fixed the tests |
sudermanjr
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #522 & #728
Checklist
Description
What's the goal of this PR?
This PR improves the
FormatResourceListfunction to handle memory unit conversion more accurately.The previous implementation attempted to shorten strings by forcing conversions to Decimal scales (Kilo, Mega, Giga - Base 10), whereas Kubernetes memory is standardly represented in BinarySI (Ki, Mi, Gi - Base 2). This led to confusing displays (e.g.,
1.05Ginstead of1024Mi) and potential precision loss due to theRoundUpmethod.Additionally, raw byte values from VPA recommendations (e.g.,
104857600) were sometimes displayed as raw bytes instead of human-readable units.What changes did you make?
The logic has been updated to:
BinarySIformatting (Ki, Mi, Gi).Set()is called to refresh the string representation even for existing round numbers.Fixes #522
Fixes #728