Change GetTopologyPodAdmitHandler() to be more general

GetTopologyPodAdmitHandler() now returns a lifecycle.PodAdmitHandler
type instead of the TopologyManager directly. The handler it returns
is generally responsible for attempting to allocate any resources that
require a pod admission check. When the TopologyManager feature gate
is on, this comes directly from the TopologyManager. When it is off,
we simply attempt the allocations ourselves and fail the admission
on an unexpected error. The higher level kubelet.go feature gate
check will be removed in an upcoming PR.
This commit is contained in:
Kevin Klues
2020-02-02 22:03:01 +00:00
committed by nolancon
parent 0b168f0243
commit 0d68bffd03
4 changed files with 47 additions and 12 deletions

View File

@@ -117,8 +117,8 @@ func (cm *containerManagerStub) ShouldResetExtendedResourceCapacity() bool {
return cm.shouldResetExtendedResourceCapacity
}
func (cm *containerManagerStub) GetTopologyPodAdmitHandler() topologymanager.Manager {
return nil
func (cm *containerManagerStub) GetTopologyPodAdmitHandler() lifecycle.PodAdmitHandler {
return topologymanager.NewFakeManager()
}
func (cm *containerManagerStub) UpdateAllocatedDevices() {