From 9a9165cc3002bec70db306eb2b2b238aae7c5e8c Mon Sep 17 00:00:00 2001 From: zc Date: Thu, 7 Jan 2021 11:53:03 +0800 Subject: [PATCH] bugfix: dispense hard volume (#311) --- resources/volume/volume.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/volume/volume.go b/resources/volume/volume.go index 9e70457e6..a99aa0519 100644 --- a/resources/volume/volume.go +++ b/resources/volume/volume.go @@ -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 @@ -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]