Skip to content

Commit

Permalink
fix reschedule issue
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Feb 1, 2023
1 parent 16f8ff4 commit 2de4977
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/calculate/realloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func calculateRealloc(c *cli.Context) error {
return nil, types.ErrEmptyNodeName
}

workloadResource := in.RawParams("workload_request")
workloadResource := in.RawParams("workload_resource")
workloadResourceRequest := in.RawParams("workload_resource_request")

return s.CalculateRealloc(c.Context, nodename, workloadResource, workloadResourceRequest)
Expand Down
4 changes: 3 additions & 1 deletion storage/calculate.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ func (p Plugin) CalculateRealloc(ctx context.Context, nodename string, resource
if err := originResource.Parse(resource); err != nil {
return nil, err
}

resourceInfo, err := p.doGetNodeResourceInfo(ctx, nodename)
if err != nil {
logger.Error(ctx, err, "failed to get resource info of node")
return nil, err
}

// check if volume rescheduling is needed
if req.VolumesRequest == nil {
req.VolumesRequest = req.VolumesLimit
}
needVolumeReschedule := utils.Any(req.VolumesRequest, func(volume *storagetypes.VolumeBinding) bool { return volume.RequireSchedule() || volume.RequireIOPS() })

req = &storagetypes.WorkloadResourceRequest{
Expand Down

0 comments on commit 2de4977

Please sign in to comment.