mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #102781 from fromanirh/fix-issue102780
cm: handle nil cpumanager avoiding segfault
This commit is contained in:
commit
98587127da
@ -1073,11 +1073,17 @@ func (cm *containerManagerImpl) GetAllocatableDevices() []*podresourcesapi.Conta
|
||||
}
|
||||
|
||||
func (cm *containerManagerImpl) GetCPUs(podUID, containerName string) []int64 {
|
||||
if cm.cpuManager != nil {
|
||||
return cm.cpuManager.GetCPUs(podUID, containerName).ToSliceNoSortInt64()
|
||||
}
|
||||
return []int64{}
|
||||
}
|
||||
|
||||
func (cm *containerManagerImpl) GetAllocatableCPUs() []int64 {
|
||||
if cm.cpuManager != nil {
|
||||
return cm.cpuManager.GetAllocatableCPUs().ToSliceNoSortInt64()
|
||||
}
|
||||
return []int64{}
|
||||
}
|
||||
|
||||
func (cm *containerManagerImpl) ShouldResetExtendedResourceCapacity() bool {
|
||||
|
Loading…
Reference in New Issue
Block a user