Skip to content

Commit c45f131

Browse files
committed
Fix some whitespacing and comments in devicemanager
1 parent 9c41989 commit c45f131

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/kubelet/cm/devicemanager/manager.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi
658658
return nil, nil
659659
}
660660
klog.V(3).Infof("Needs to allocate %d %q for pod %q container %q", needed, resource, podUID, contName)
661-
// Needs to allocate additional devices.
661+
// Check if resource registered with devicemanager
662662
if _, ok := m.healthyDevices[resource]; !ok {
663663
return nil, fmt.Errorf("can't allocate unregistered device %s", resource)
664664
}
@@ -675,9 +675,10 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi
675675
if m.allocatedDevices[resource] == nil {
676676
m.allocatedDevices[resource] = sets.NewString()
677677
}
678+
678679
// Gets Devices in use.
679680
devicesInUse := m.allocatedDevices[resource]
680-
// Gets a list of available devices.
681+
// Gets Available devices.
681682
available := m.healthyDevices[resource].Difference(devicesInUse)
682683
if available.Len() < needed {
683684
return nil, fmt.Errorf("requested number of devices unavailable for %s. Requested: %d, Available: %d", resource, needed, available.Len())

0 commit comments

Comments
 (0)