fix: print the class and utilization a pool actually has - #127
Merged
Merged
Conversation
Staging showed both columns reading <none> and 0% for nearly every pool. Exactly one of spec.classNames and spec.classRef is set on any given pool: an operator-authored pool lists the classes it offers itself to, a provisioned one names the class that carved it. The column read only the first, so every cascade-provisioned pool printed <none>. It now falls back, and the redundant wide column is gone. status.utilizationPercent is rounded to four decimal places, and an IPv6 pool is large enough that a real allocation rounds to zero — a /48 out of a /32 is 0.0000%. Whether a pool has been drawn on is now read from the exact capacity counts, and the percentage only says how much.
scotwells
requested review from
JoseSzycho,
ecv,
kevwilliams,
mattdjenkinson and
savme
September 23, 2026 01:43
ecv
approved these changes
Sep 23, 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.
Problem
The new columns shipped in #126 look right in tests and wrong against real data. Staging:
Two separate bugs:
Class is empty on most pools. Exactly one of
spec.classNamesandspec.classRefis set: an operator-authored pool lists the classes it offers itself to, a cascade-provisioned pool names the class that carved it. The column read only the first, so every provisioned pool — nearly all of them — printed<none>, while the field that was populated sat behind-o wide.Utilization is 0% on pools that are not empty.
status.utilizationPercentis rounded to four decimal places, and an IPv6 pool is big enough that a real allocation rounds away: the fabric-identity root hasallocated: 1033017668127734890496oftotal: 79228162514264337593543950336and reports0. The<0.1%guard I added keyed off that rounded number, so it never fired.Change
Class falls back to
classRefwhenclassNamesis empty, and the now-duplicate wide column is dropped.Utilization reads whether a pool has been drawn on from
status.capacity.allocated, which is exact, and uses the percentage only for how much. The counts are decimal strings because an IPv6 pool overflows every integer type, so the check parses them asbig.Int.Left out
Both fixes are in the printer only; no status field or API type changes. Tests use the real staging numbers as fixtures.