fix: show usage against ∞ when a workspace has no resource quota - #634
Open
terrywu510 wants to merge 1 commit into
Open
fix: show usage against ∞ when a workspace has no resource quota#634terrywu510 wants to merge 1 commit into
terrywu510 wants to merge 1 commit into
Conversation
terrywu510
requested review from
KUASWoodyLIN,
ZhangEnYao and
iasthc
as code owners
August 19, 2026 08:15
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
On Overview → Quota usage, the CPU / RAM / GPU Memory gauges take both their
numerator and denominator from
kube_resourcequota. When a workspace is set toUnlimited, the Workspace CR carries no
spec.resourceQuota.hard, so noResourceQuota is created for the namespace and the whole metric family is absent
— the
usedcounter as well ashard. All three cards therefore rendered"No data" and the tile appeared empty.
Change
[cluster]/[workspace]/+layout.server.tsalready fetches the Workspace toresolve
spec.namespace; it now also returnsquotaUnlimited(
spec.resourceQuota.hard === undefined) — the same definition the workspacecreate/update forms use for their "Unlimited" checkbox. The flag is threaded
through the overview page and the dashboard shell to the quota tile only.
sum(kube_pod_container_resource_{requests,limits}{namespace,resource,unit} <LIVE_PODS>),reusing the existing
LIVE_PODShelper (Pending|Running) so the numeratormatches what a ResourceQuota would have counted, and stays consistent with the
cluster analytics namespace commitment panels. GPU Memory already derived its
numerator from pod containers, so that query is unchanged. The six
kube_resourcequotaqueries are skipped entirely in this mode.replaced by
∞, the sub-label reads<current usage> / ∞, and the hard totalin each card header shows
∞. A failed usage query still falls back to theusual "No data" state.
unchanged. A resource that individually omits its
hardentry also keepstoday's behavior (GPU Memory still shows
0 / 0) — only a wholly unlimitedworkspace switches to the ∞ presentation.
Verification
pnpm check(svelte-check): 0 errors, 0 warningseslint/prettier: cleanworkspace with a quota, on the Requests and Limits views.