Skip to content

Commit

Permalink
bugfix: dispense hard volume (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwinger233 authored Jan 7, 2021
1 parent c31e6ee commit 9a9165c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,12 @@ func (rp ResourcePlans) RollbackChangesOnNode(node *types.Node, indices ...int)

// Dispense .
func (rp ResourcePlans) Dispense(opts resourcetypes.DispenseOptions, r *types.ResourceMeta) (*types.ResourceMeta, error) {
r.VolumeRequest = rp.request
r.VolumeLimit = rp.limit
if len(rp.plan) == 0 {
return r, nil
}

r.VolumeRequest = rp.request
r.VolumePlanRequest = rp.plan[opts.Node.Name][opts.Index]

// if there are existing ones, ensure new volumes are compatible
Expand All @@ -181,7 +182,6 @@ func (rp ResourcePlans) Dispense(opts resourcetypes.DispenseOptions, r *types.Re
}

// fix plans while limit > request
r.VolumeLimit = rp.limit
r.VolumePlanLimit = types.VolumePlan{}
for i := range rp.request {
request, limit := rp.request[i], rp.limit[i]
Expand Down

0 comments on commit 9a9165c

Please sign in to comment.