Skip to content

Commit

Permalink
Merge pull request #265 from Amber-976/add-nodecache-check-dx
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-wangxu authored Aug 15, 2024
2 parents e80c0c2 + d64c72c commit 17d68a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/scheduler/algorithm/cache/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,13 @@ func (c *ClusterNodeCache) assumeLVMAllocatedUnit(unit AllocatedUnit, nodeCache
// vg is not found
return nil, fmt.Errorf("vg %s/%s is not found in cache, please retry later", nodeCache.NodeName, unit.VgName)
}
nodeCache.AllocatedNum += 1
nodeCache.PVCRecordsByExtend[unit.PVCName] = unit
if _, exist := nodeCache.PVCRecordsByExtend[unit.PVCName]; !exist {
nodeCache.AllocatedNum += 1
nodeCache.PVCRecordsByExtend[unit.PVCName] = unit
} else {
log.V(6).Infof("pvc: %s is already existed on nodeCache node: %s, not update node cache", unit.PVCName, nodeCache.NodeName)
return nodeCache, nil
}
nodeCache.VGs[ResourceName(vg.Name)] = SharedResource{
Name: vg.Name,
Capacity: vg.Capacity,
Expand Down

0 comments on commit 17d68a1

Please sign in to comment.