Skip to content

fix: print the class and utilization a pool actually has - #127

Merged
scotwells merged 1 commit into
mainfrom
fix/table-columns-real-data
Sep 23, 2026
Merged

scotwells merged 1 commit into
mainfrom
fix/table-columns-real-data

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Problem

The new columns shipped in #126 look right in tests and wrong against real data. Staging:

NAME                                                          CIDR            FAMILY   CLASSES   UTILIZATION   AGE
datum-fabric-identity-root                                    fd30::/32       IPv6     ...       0%            26d
datum-subnet-ipv6-datum-cloud-us-central-1-default-72362560   fd20:0:f::/64   IPv6     <none>    0%            12d

Two separate bugs:

Class is empty on most pools. Exactly one of spec.classNames and spec.classRef is 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.utilizationPercent is rounded to four decimal places, and an IPv6 pool is big enough that a real allocation rounds away: the fabric-identity root has allocated: 1033017668127734890496 of total: 79228162514264337593543950336 and reports 0. The <0.1% guard I added keyed off that rounded number, so it never fired.

Change

Class falls back to classRef when classNames is 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 as big.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.

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
scotwells merged commit 4616368 into main Sep 23, 2026
11 checks passed
@scotwells
scotwells deleted the fix/table-columns-real-data branch September 23, 2026 01:44
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.

2 participants