mirror of
https://github.com/outbackdingo/kubernetes.git
synced 2026-02-21 10:20:24 +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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user