mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Remove unnecessary union after call to GetPreferredAllocation()
There is no need to try and allocate already-allocated devices again.
This commit is contained in:
parent
67ecc11c44
commit
26cb650655
@ -709,7 +709,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if allocateRemainingFrom(preferred.Intersection(aligned.Union(allocated))) {
|
||||
if allocateRemainingFrom(preferred.Intersection(aligned)) {
|
||||
return allocated, nil
|
||||
}
|
||||
// Then fallback to allocate from the aligned set if no preferred list
|
||||
@ -734,7 +734,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if allocateRemainingFrom(preferred.Intersection(available.Union(allocated))) {
|
||||
if allocateRemainingFrom(preferred.Intersection(available)) {
|
||||
return allocated, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user