Skip to content

Automated cherry pick of #15279: Resize the StatefulSet workload when scaling up from zero to a different size - #15303

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:release-0.18from
sohankunkerkar:automated-cherry-pick-of-#15279-origin-release-0.18
Sep 9, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:release-0.18from
sohankunkerkar:automated-cherry-pick-of-#15279-origin-release-0.18

Conversation

@sohankunkerkar

Copy link
Copy Markdown
Member

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

StatefulSet: Fixed a bug where scaling a StatefulSet to zero and then back up to a different number of replicas left the Workload with the original pod count, causing it to be admitted and charged quota for the wrong number of pods.

Copilot AI lite review requested due to automatic review settings September 8, 2026 20:38
@kubernetes-prow kubernetes-prow Bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 8, 2026
@kubernetes-prow kubernetes-prow Bot added this to the v0.18 milestone Sep 8, 2026
@kubernetes-prow kubernetes-prow Bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 8, 2026
@netlify

netlify Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 1b05d64
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-kueue/deploys/6aa07aeea3f2100007e6f860

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 90d2fd60-fdc0-4c9f-8b37-812b034379ba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 8, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from mimowo and tenzen-y September 8, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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[].count when 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 existing ptr.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>
@sohankunkerkar
sohankunkerkar force-pushed the automated-cherry-pick-of-#15279-origin-release-0.18 branch from 6b5b716 to 1b05d64 Compare September 8, 2026 21:15
@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 8, 2026
@mimowo

mimowo commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve
/test pull-kueue-verify-release-0-18

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2026
@kubernetes-prow

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: e62156e0624d876270e5b9986a4cf5b152c495b9

@kubernetes-prow

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [mimowo,sohankunkerkar]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot merged commit 54baca3 into kubernetes-sigs:release-0.18 Sep 9, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants