Skip to content

Commit 29b76ef

Browse files
fix: skip runtimeClassName injection when gpuPodRuntimeClassName is e… (#1131)
Signed-off-by: Yuan Chen <yuanchen97@gmail.com> Co-authored-by: Yuan Chen <yuanchen97@gmail.com>
1 parent 9f927ed commit 29b76ef

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7-
## [Unreleased]
7+
## [v0.9.13] - 2026-03-04
88

99
### Fixed
1010
- Fixed a bug where queue status did not reflect its podgroups resources correctly [#1049](https://github.com/NVIDIA/KAI-Scheduler/pull/1049)
1111
- Fixed plugin server (snapshot and job-order endpoints) listening on all interfaces by binding to localhost only.
12+
- Fixed admission webhook to skip runtimeClassName injection when gpuPodRuntimeClassName is empty [#1035](https://github.com/NVIDIA/KAI-Scheduler/pull/1035)
1213

1314
## [v0.9.12] - 2026-01-21
1415

pkg/admission/webhook/v1alpha2/runtimeenforcement/runtime_enforcement.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ func (p *RuntimeEnforcement) Validate(pod *v1.Pod) error {
3030
}
3131

3232
func (p *RuntimeEnforcement) Mutate(pod *v1.Pod) error {
33+
// Skip runtimeClassName injection entirely when configured with empty string
34+
if p.gpuPodRuntimeClassName == "" {
35+
return nil
36+
}
37+
3338
// in order to no collide with custom reservation pods runtimeClass
3439
if resourcereservation.IsGPUReservationPod(pod) {
3540
return nil

pkg/admission/webhook/v1alpha2/runtimeenforcement/runtime_enforcement_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,33 @@ func TestMutate(t *testing.T) {
8181
},
8282
expectedError: nil,
8383
},
84+
{
85+
name: "empty gpuPodRuntimeClassName skips runtimeClass injection",
86+
gpuPodRuntimeClassName: "",
87+
incomingPod: &v1.Pod{
88+
Spec: v1.PodSpec{
89+
Containers: []v1.Container{
90+
{
91+
Resources: v1.ResourceRequirements{
92+
Limits: v1.ResourceList{constants.GpuResource: resource.MustParse("1")},
93+
},
94+
},
95+
},
96+
},
97+
},
98+
expectedOutboundPod: &v1.Pod{
99+
Spec: v1.PodSpec{
100+
Containers: []v1.Container{
101+
{
102+
Resources: v1.ResourceRequirements{
103+
Limits: v1.ResourceList{constants.GpuResource: resource.MustParse("1")},
104+
},
105+
},
106+
},
107+
},
108+
},
109+
expectedError: nil,
110+
},
84111
{
85112
name: "pod with GPU request and runtimeClassName set",
86113
gpuPodRuntimeClassName: constants.DefaultRuntimeClassName,

0 commit comments

Comments
 (0)