Repository navigation
Automated cherry pick of #15279: Resize the StatefulSet workload when scaling up from zero to a different size - #15303
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
🟡 Changes recommended
The new integration test uses new(int32(…)) for replica pointers, which is invalid in this package and will not compile (should use the existing ptr.To[int32](…) pattern).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Cherry-picks a fix onto release-0.18 to ensure a Kueue-managed StatefulSet’s associated Workload is resized correctly when scaling from 0 replicas back up to a different replica count, preventing re-admission/quota charging with a stale pod count.
Changes:
- Resync
Workload.spec.podSets[].countwhen clearing the “OnHold” state so scale-up from zero is admitted with the correct pod count. - Add/extend integration coverage around StatefulSet rollout gating behavior and the 0→N resize/re-admission scenario.
File summaries
| File | Description |
|---|---|
| pkg/controller/jobs/statefulset/statefulset_reconciler.go | Resync pod-set counts while clearing OnHold so workloads re-admit at the updated replica count. |
| test/integration/singlecluster/controller/jobs/statefulset/statefulset_controller_test.go | Adds integration tests for rollout gating behavior and for resizing workload counts when scaling 0→different N. |
Review details
Suppressed comments (1)
test/integration/singlecluster/controller/jobs/statefulset/statefulset_controller_test.go:353
new(int32(5))is not valid Go syntax in this package; this will not compile. Use the existingptr.To[int32](...)pattern used elsewhere in this file to set the pointer value.
createdSTS.Spec.Replicas = new(int32(5))
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ent size Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
6b5b716 to
1b05d64
Compare
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: e62156e0624d876270e5b9986a4cf5b152c495b9 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mimowo, sohankunkerkar The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
54baca3
into
kubernetes-sigs:release-0.18
Cherry pick of #15279 on release-0.18.
#15279: Resize the StatefulSet workload when scaling up from zero to a different size
For details on the cherry pick process, see the cherry pick requests page.
What type of PR is this?
/kind bug