Skip to content

Commit

Permalink
fix: nil pointer when set node other resources
Browse files Browse the repository at this point in the history
Signed-off-by: zhitianli <[email protected]>
  • Loading branch information
zhitianli committed Sep 29, 2024
1 parent 5d3106d commit 0a0c06d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/scheduler/api/node_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ func (ni *NodeInfo) SetNode(node *v1.Node) {

// setNodeOthersResource initialize sharable devices
func (ni *NodeInfo) setNodeOthersResource(node *v1.Node) {
if node == nil {
klog.Warningf("received argument of nil node, no need to set other resources for %s", ni.Name)
return
}

ni.Others[GPUSharingDevice] = gpushare.NewGPUDevices(ni.Name, node)
ni.Others[vgpu.DeviceName] = vgpu.NewGPUDevices(ni.Name, node)
IgnoredDevicesList.Set(
Expand Down

0 comments on commit 0a0c06d

Please sign in to comment.