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

kubernetes-sigs / lws / 36310016928
88%

Build:
DEFAULT BRANCH: main
Ran 27 Sep 2026 09:41AM UTC
Jobs 1
Files 31
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

27 Sep 2026 09:38AM UTC coverage: 84.338% (+0.2%) from 84.11%
36310016928

push

github

web-flow
fix: reconcile LeaderWorkerSet on member pod deletion to clean up obsolete PodGroups (#1096)

When using the kubernetes scheduler provider, scaling down or scaling to
zero could leave obsolete PodGroup objects in the cluster whenever a worker
pod was the last member pod to terminate. This occurred because
LeaderWorkerSetReconciler.SetupWithManager previously filtered out all
worker pod events inside its mapping function, dropping the final DeleteEvent.

This change:
1. Replaces the inline map function with enqueueLWSRequests so that member pod
   deletions can trigger reconciliation for the LeaderWorkerSet.
2. Extracts podWatchPredicate into a separate method with explicit predicates:
   - CreateFunc: only leader pods (worker-index: "0") trigger reconciliation.
   - UpdateFunc: only leader pods with changes to
     GroupRestartBudgetExhaustedAnnotationKey trigger reconciliation.
   - DeleteFunc: leader pods always trigger reconciliation; worker pods only
     trigger reconciliation if KubernetesProvider is active and the pod has
     spec.schedulingGroup or WorkloadSchedulingAnnotationKey.
   - GenericFunc: explicitly set to return false.
3. Adds unit tests for podWatchPredicate and extends TestEnqueueLWSRequests.
4. Adds an integration test in workload_scheduling_test.go verifying PodGroup
   cleanup when a worker pod is the last to be deleted during scale-down.

Signed-off-by: Harry Li <harrymingh@gmail.com>

30 of 34 new or added lines in 1 file covered. (88.24%)

4 existing lines in 1 file now uncovered.

5805 of 6883 relevant lines covered (84.34%)

37.06 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
84.42
1.8% pkg/controllers/leaderworkerset_controller.go

Coverage Regressions

Lines Coverage ∆ File
4
84.42
1.8% pkg/controllers/leaderworkerset_controller.go
Jobs
ID Job ID Ran Files Coverage
1 36310016928.1 27 Sep 2026 09:41AM UTC 31
84.34
GitHub Action Run
Source Files on build 36310016928
  • Tree
  • List 31
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • e72548f4 on github
  • Prev Build on main (#36265601820)
  • Next Build on main (#36396598695)
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