Skip to content

Commit a9f834d

Browse files
committed
Implement noopWindowsResourceAllocator
On Windows, the podAdmitHandler returned by the GetAllocateResourcesPodAdmitHandler() func and registered by the Kubelet is nil. We implement a noopWindowsResourceAllocator that would admit any pod for Windows in order to be consistent with the original implementation.
1 parent 61847ea commit a9f834d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/kubelet/cm/container_manager_windows.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ type containerManagerImpl struct {
5454
nodeConfig NodeConfig
5555
}
5656

57+
type noopWindowsResourceAllocator struct{}
58+
59+
func (ra *noopWindowsResourceAllocator) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult {
60+
return lifecycle.PodAdmitResult{
61+
Admit: true,
62+
}
63+
}
64+
5765
func (cm *containerManagerImpl) Start(node *v1.Node,
5866
activePods ActivePodsFunc,
5967
sourcesReady config.SourcesReady,
@@ -178,7 +186,7 @@ func (cm *containerManagerImpl) ShouldResetExtendedResourceCapacity() bool {
178186
}
179187

180188
func (cm *containerManagerImpl) GetAllocateResourcesPodAdmitHandler() lifecycle.PodAdmitHandler {
181-
return nil
189+
return &noopWindowsResourceAllocator{}
182190
}
183191

184192
func (cm *containerManagerImpl) UpdateAllocatedDevices() {

0 commit comments

Comments
 (0)