Merge pull request #95734 from fromanirh/podresources-concrete-resources-apis

podresources APIs: concrete resources apis: implement GetAllocatableResources
This commit is contained in:
Kubernetes Prow Robot
2021-03-09 14:29:04 -08:00
committed by GitHub
31 changed files with 1995 additions and 117 deletions

View File

@@ -1070,13 +1070,21 @@ func (cm *containerManagerImpl) GetDevicePluginResourceCapacity() (v1.ResourceLi
}
func (cm *containerManagerImpl) GetDevices(podUID, containerName string) []*podresourcesapi.ContainerDevices {
return cm.deviceManager.GetDevices(podUID, containerName)
return containerDevicesFromResourceDeviceInstances(cm.deviceManager.GetDevices(podUID, containerName))
}
func (cm *containerManagerImpl) GetAllocatableDevices() []*podresourcesapi.ContainerDevices {
return containerDevicesFromResourceDeviceInstances(cm.deviceManager.GetAllocatableDevices())
}
func (cm *containerManagerImpl) GetCPUs(podUID, containerName string) []int64 {
return cm.cpuManager.GetCPUs(podUID, containerName).ToSliceNoSortInt64()
}
func (cm *containerManagerImpl) GetAllocatableCPUs() []int64 {
return cm.cpuManager.GetAllocatableCPUs().ToSliceNoSortInt64()
}
func (cm *containerManagerImpl) ShouldResetExtendedResourceCapacity() bool {
return cm.deviceManager.ShouldResetExtendedResourceCapacity()
}