Skip to content

fix(api): allow PodGroup minMember of 0 (v0.9 backport) - #2087

Closed
gshaibi wants to merge 1 commit into
v0.9from
backport-1989-to-v0.9
Closed

fix(api): allow PodGroup minMember of 0 (v0.9 backport)#2087
gshaibi wants to merge 1 commit into
v0.9from
backport-1989-to-v0.9

Conversation

@gshaibi

@gshaibi gshaibi commented Aug 17, 2026

Copy link
Copy Markdown
Member

Description

Backport of #1989 to v0.9.

Adapted for this branch: MinMember here is a plain int32 (not *int32 as on main), there is no minSubGroup, and this branch never had a Minimum=1 CRD marker (explicit minMember: 0 was already accepted by the API but silently clamped to 1 by the scheduler). Changes:

  • Scheduler no longer clamps minMember to 1 (max(minMember, 0) instead of max(minMember, 1)), so minMember 0 now means no gang requirement (e.g. knative scale-to-zero).
  • Doc comment added to the API type; CRD description regenerated via make manifests.
  • The minSubGroup webhook/e2e changes from the original PR are dropped (field does not exist on this branch).

Note: since int32 with omitempty cannot distinguish an unset minMember from an explicit 0, a PodGroup created without minMember now gets minAvailable 0 (elastic) instead of the previous implicit 1. Podgrouper-created PodGroups always set it, so this only affects hand-written PodGroups.

Same adaptation as the v0.14 (#2085) and v0.12 (#2086) backports.

Related Issues

Backport of #1989.

Checklist

  • Self-reviewed
  • Added/updated tests (if needed)
  • Updated documentation (if needed)
  • Added a changelog fragment via make changelog (or applied the skip-changelog label). Do not edit CHANGELOG.md directly — pending fragments are folded into it at release time.

Breaking Changes

None.

Additional Notes

Unit tests pass for pkg/scheduler/api/podgroup_info and pkg/podgrouper/.../knative.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

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

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 136c3a36-43c1-4928-9aa2-be1036aa81e6

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Backport of 62c594b to v0.9, adapted
for non-pointer MinMember and the SubGroups-based scheduler API.

Signed-off-by: lin121291 <4jp33f9e@gmail.com>

Signed-off-by: gshaibi <gshaibi@nvidia.com>
@gshaibi
gshaibi force-pushed the backport-1989-to-v0.9 branch from 176160c to ca9d1c1 Compare August 17, 2026 12:21
@gshaibi
gshaibi enabled auto-merge (squash) August 17, 2026 12:29
@gshaibi

gshaibi commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

Closing: the bug does not exist on v0.9. This branch never had the Minimum=1 CRD marker (nor a webhook check), so minMember: 0 is already accepted by the API. The scheduler's default of minAvailable 1 when minMember is 0/unset is the existing branch contract (MinMember is a non-pointer int32 here, so unset and explicit 0 are indistinguishable), and changing it would alter gang semantics for existing PodGroups in a patch release — see the v0.14/v0.12 backports #2085/#2086 which keep that behavior for the same reason.

@gshaibi gshaibi closed this Aug 17, 2026
auto-merge was automatically disabled August 17, 2026 13:06

Pull request was closed

@gshaibi
gshaibi deleted the backport-1989-to-v0.9 branch August 17, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants