mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
gpu rm linter comment fixes
Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
This commit is contained in:
parent
e0b3cf1654
commit
0670a82cb1
@ -73,6 +73,7 @@ type DeviceInfo struct {
|
|||||||
|
|
||||||
type getClientFunc func(string, time.Duration, int) (podresourcesv1.PodResourcesListerClient, *grpc.ClientConn, error)
|
type getClientFunc func(string, time.Duration, int) (podresourcesv1.PodResourcesListerClient, *grpc.ClientConn, error)
|
||||||
|
|
||||||
|
// ResourceManager interface for the fractional resource handling.
|
||||||
type ResourceManager interface {
|
type ResourceManager interface {
|
||||||
ReallocateWithFractionalResources(*pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
|
ReallocateWithFractionalResources(*pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
|
||||||
SetDevInfos(DeviceInfoMap)
|
SetDevInfos(DeviceInfoMap)
|
||||||
@ -88,6 +89,7 @@ type resourceManager struct {
|
|||||||
prGetClientFunc getClientFunc
|
prGetClientFunc getClientFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewDeviceInfo creates a new DeviceInfo.
|
||||||
func NewDeviceInfo(nodes []pluginapi.DeviceSpec, mounts []pluginapi.Mount, envs map[string]string) *DeviceInfo {
|
func NewDeviceInfo(nodes []pluginapi.DeviceSpec, mounts []pluginapi.Mount, envs map[string]string) *DeviceInfo {
|
||||||
return &DeviceInfo{
|
return &DeviceInfo{
|
||||||
nodes: nodes,
|
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
|
type DeviceInfoMap map[string]*DeviceInfo
|
||||||
|
|
||||||
|
// NewDeviceInfoMap creates a new DeviceInfoMap.
|
||||||
func NewDeviceInfoMap() DeviceInfoMap {
|
func NewDeviceInfoMap() DeviceInfoMap {
|
||||||
return DeviceInfoMap{}
|
return DeviceInfoMap{}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// IsSriovPFwithVFs returns true if the device with given pfpath has virtual functions, false otherwise.
|
||||||
func IsSriovPFwithVFs(pfpath string) bool {
|
func IsSriovPFwithVFs(pfpath string) bool {
|
||||||
dat, err := os.ReadFile(path.Join(pfpath, "device/sriov_numvfs"))
|
dat, err := os.ReadFile(path.Join(pfpath, "device/sriov_numvfs"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user