From d87365494a87927ef32b4b43ada19ff67d3cddc3 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Sat, 4 Jul 2020 12:30:38 +0000 Subject: [PATCH] Fix bug in call to callGetPreferredAllocationIfAvailable() Previously, we were passing the variable 'devices' to this function, when we should have been passing 'allocated'. This bug crept in due to a variable name change that didn't propogate its way through the entire function. The tests added in the previous commit would have caught this. --- pkg/kubelet/cm/devicemanager/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/cm/devicemanager/manager.go b/pkg/kubelet/cm/devicemanager/manager.go index 8f35d87a761..ad56ca57ffc 100644 --- a/pkg/kubelet/cm/devicemanager/manager.go +++ b/pkg/kubelet/cm/devicemanager/manager.go @@ -730,7 +730,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi // Then give the plugin the chance to influence the decision on any // remaining devices to allocate. - preferred, err := m.callGetPreferredAllocationIfAvailable(podUID, contName, resource, available.Union(devices), devices, required) + preferred, err := m.callGetPreferredAllocationIfAvailable(podUID, contName, resource, available.Union(allocated), allocated, required) if err != nil { return nil, err }