gpu rm linter comment fixes

Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
This commit is contained in:
Ukri Niemimuukko 2021-09-10 14:10:53 +03:00
parent e0b3cf1654
commit 0670a82cb1
2 changed files with 5 additions and 0 deletions

View File

@ -73,6 +73,7 @@ type DeviceInfo struct {
type getClientFunc func(string, time.Duration, int) (podresourcesv1.PodResourcesListerClient, *grpc.ClientConn, error)
// ResourceManager interface for the fractional resource handling.
type ResourceManager interface {
ReallocateWithFractionalResources(*pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
SetDevInfos(DeviceInfoMap)
@ -88,6 +89,7 @@ type resourceManager struct {
prGetClientFunc getClientFunc
}
// NewDeviceInfo creates a new DeviceInfo.
func NewDeviceInfo(nodes []pluginapi.DeviceSpec, mounts []pluginapi.Mount, envs map[string]string) *DeviceInfo {
return &DeviceInfo{
nodes: nodes,
@ -96,8 +98,10 @@ func NewDeviceInfo(nodes []pluginapi.DeviceSpec, mounts []pluginapi.Mount, envs
}
}
// DeviceInfoMap is a map of device infos. deviceId -> *DeviceInfo.
type DeviceInfoMap map[string]*DeviceInfo
// NewDeviceInfoMap creates a new DeviceInfoMap.
func NewDeviceInfoMap() DeviceInfoMap {
return DeviceInfoMap{}
}

View File

@ -20,6 +20,7 @@ import (
"strings"
)
// IsSriovPFwithVFs returns true if the device with given pfpath has virtual functions, false otherwise.
func IsSriovPFwithVFs(pfpath string) bool {
dat, err := os.ReadFile(path.Join(pfpath, "device/sriov_numvfs"))