Skip to content

humanizeBytes renders Ki-range sizes as raw bytes #3105

Closed

Description

humanizeBytes (apps/console/src/lib/k8s-quantity.ts:32) has branches for Ti/Gi/Mi and then falls through to ${bytes}B, with no Ki branch. Any value in the range [1024, 1024²) bytes is rendered as raw bytes — for example a 512Ki PersistentVolumeClaim shows as 524288B instead of 512Ki.

This surfaces in the Storage admin views (ClusterStorageSection, StorageClassUsagePage), which feed PVC requested/bound sizes through humanizeBytes. PVCs are usually Gi-sized, so it rarely bites in practice, but any Ki/sub-Mi value displays incorrectly.

The current behavior is pinned by k8s-quantity.test.ts, so the fix must update that test.

Suggested fix: add a bytes >= 1024 → Ki branch before the bytes fallback, with a test covering a Ki-range value.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    priority/backlogGeneral backlog priority. Lower than priority/important-longterm
    on Jun 2, 2026
  2. added
    kind/bugCategorizes issue or PR as related to a bug
    priority/backlogGeneral backlog priority. Lower than priority/important-longterm
    area/dashboardIssues or PRs related to the dashboard / UI
    on Jun 26, 2026
  3. added a commit that references this issue on Aug 17, 2026
    5ee0094
  4. added a commit that references this issue on Aug 27, 2026
    cd3d5e6
  5. added a commit that references this issue on Oct 7, 2026
    fa3db54
  6. added a commit that references this issue on Oct 11, 2026
    bcde187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dashboardIssues or PRs related to the dashboard / UIkind/bugCategorizes issue or PR as related to a bugpriority/backlogGeneral backlog priority. Lower than priority/important-longtermtriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions