Pull Request Overview
- Opened on October 21, 2026
- Status Open
- Commit count 1 with first commit October 21, 2026
Total Delta
Open Days
Test Delta
How long has this pull request spent in each phase of its lifecycle?
| Fraction of total time | Business days | Phase |
|---|---|---|
| N/A | 0.0 days | Issue creation to work beginning |
|
|
0.0 days | Authoring 0 commits before pull request opened for review |
|
|
3.0 days | Awaiting first review |
|
|
20.0 days | Revising work with 1 commit in response to 1 review that left 6 comments |
Total time for pull request still awaiting merge (longer than repo's target): 23.0 business days
Fix PodGroup preemption policy resolution from PriorityClass
What type of PR is this?
/kind bug
/sig scheduling
What this PR does / why we need it:
Leave an unset preemptionPolicy in a PodGroup or CompositePodGroup unset until priority admission resolves it from the PriorityClass, matching the Pod admission flow.
Before, API defaulting set PreemptLowerPriority for PriorityClass before admission ran. A group referencing a different PriorityClass with preemptionPolicy: Never was then rejected even when the user omitted the group's policy.
Removed this early defaulting for PodGroup (v1alpha3 and v1beta1) and for CompositePodGroup (v1alpha3). When policies are explicit it is kept, and priority admission continues rejecting policies that conflict with the PriorityClass. PriorityClass defaulting is unchanged when the policy is actually nil.
Which issue(s) this PR is related to:
Fixes #143252
Special notes for your reviewer:
The new integration test fails on master before this fix.
Validation:
- Scheduling API, PodGroup/CompositePodGroup registry, and priority-admission unit tests
- TestPodGroupPriorityClassPreemptionPolicy API-server integration test
- TestRoundTripTypes API serialization tests
- make update + golangci-lint
Does this PR introduce a user-facing change?
PodGroup and CompositePodGroup creation will no longer be rejected when preemptionPolicy is unset and the referenced PriorityClass specifies preemptionPolicy: Never.
AI usage disclosure:
Yes
What happened?
When creating a PodGroup that references a PriorityClass with preemptionPolicy: Never it gets rejected by priority admission if the PodGroup doesn't set its own spec.preemptionPolicy.
API defaulting sets the omitted field to PreemptLowerPriority before admission runs. Priority admission then derives Never from the referenced PriorityClass and rejects the mismatch. Even though the user did not give any conflicting value.
Error from server (Forbidden): error when creating "pg-set-preemption-policy.yaml": podgroups.scheduling.k8s.io "test-pg" is forbidden: the string value of PreemptionPolicy (PreemptLowerPriority) must not be provided in pod group spec; priority admission controller computed Never from the given PriorityClass name
Original discussion: https://github.com/kuberay-project/kuberay/pull/5266#discussion_r4070093850 CC: @machichima @marosset
What did you expect to happen?
When spec.preemptionPolicy is not set, priority admission should populate it from the referenced PriorityClass. For this example, the PodGroup should be admitted with preemptionPolicy: Never.
Explicitly set fields that conflict with the PriorityClass should still continue to be rejected.
How can we reproduce it (as minimally and precisely as possible)?
• GenericWorkload=true
• PodGroupPreemptionPolicy=true
• scheduling.k8s.io/v1alpha3 enabled
• The Priority admission plugin enabled
Create the PriorityClass:
yaml
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: podgroup-no-preemption
value: 1000
globalDefault: false
preemptionPolicy: Never
Create a PodGroup, and do not set spec.preemptionPolicy:
yaml
apiVersion: scheduling.k8s.io/v1alpha3
kind: PodGroup
metadata:
name: preemption-policy-repro
namespace: default
spec:
priorityClassName: podgroup-no-preemption
schedulingPolicy:
gang:
minCount: 1
Creation is rejected with the error above. Explicitly adding spec.preemptionPolicy: Never avoids the error.
Anything else we need to know?
Looking into it:
https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/scheduling/v1alpha3/defaults.go#L31-L38: SetDefaults_PodGroup defaults nil to be PreemptLowerPriority when the feature gate is enabled
https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/admission/priority/admission.go#L224-L237
Priority admission derives the policy from PriorityClass and rejects a non-nil
This also exists for CompositePodGroup
Kubernetes version
<details>
$ kubectl version
v1.37.0
</details>
Cloud provider
<details>
</details>
OS version
<details>
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
</details>
Install tools
<details>
</details>
Container runtime (CRI) and version (if applicable)
<details>
</details>
Related plugins (CNI, CSI, ...) and versions (if applicable)
<details>
</details>
Comments Threads Pending Resolution
Resolved Comment Threads
No resolved comments have been left on this PR.
Only a nit in test, others lgtm.