• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubernetes-sigs / karpenter / 30962911985
83%
main: 83%

Build:
Build:
LAST BUILD BRANCH: auto/issue-2854
DEFAULT BRANCH: main
Ran 05 Aug 2026 12:36AM UTC
Jobs 1
Files 182
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Aug 2026 12:19AM UTC coverage: 82.842% (+0.009%) from 82.833%
30962911985

Pull #3206

github

pujitha24
fix(kwok): set simulated node capacity from instance type, not pod requests

Motivation:
The kwok reference cloud provider's toNode() sets a simulated Node's
Status.Capacity to the sum of pod requests that sized the NodeClaim,
instead of the selected instance type's real capacity. Status.Allocatable
already correctly merges in the instance type's real values, but Capacity
does not.

CloudProvider.Create() returns this Capacity value synchronously as
NodeClaim.Status.Capacity, before the simulated Node is actually created.
If node registration is blocked or never completes, no kubelet ever
corrects this value, so it is permanently under-reported. NodePool
resource usage (pkg/controllers/state/cluster.go) and the scheduler's
remaining-limits tracking (pkg/controllers/provisioning/scheduling/scheduler.go)
both read this stale Capacity for any node that has not yet initialized,
so a stuck NodeClaim is under-counted against NodePool spec.limits by the
difference between its pod requests and the real instance type capacity.
This matches the mechanism a reporter on the linked issue diagnosed from
their own kwok-based reproduction, using a NodePool CPU limit.

This only affects the kwok reference/test cloud provider (kwok/cloudprovider),
which is not used by any production cloud provider implementation; behavior
of real cloud providers (AWS, Azure, GCP, etc., which live in separate repos)
is unaffected.

Approach:
Merge instanceType.Capacity into the simulated Node's Status.Capacity,
mirroring how Status.Allocatable already merges in
instanceType.Allocatable(). Pod-request-derived values still apply for
any custom/extended resource not present on the instance type.

Validation:
Added kwok/cloudprovider/cloudprovider_test.go, which builds a NodeClaim
sized by a single small pod request (0.6 CPU / 256Mi) against a fake
32 CPU / 128Gi instance type and asserts the resulting simulated node's
Status.Capacity reflects the instance type, not the pod request.

Ran `g... (continued)
Pull Request #3206: fix(kwok): set simulated node capacity from instance type, not pod requests

16846 of 20335 relevant lines covered (82.84%)

96480.58 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30962911985.1 05 Aug 2026 12:36AM UTC 182
82.84
GitHub Action Run
Source Files on build 30962911985
  • Tree
  • List 182
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #3206
  • PR Base - main (#30864326551)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc