From 8a8ed6036d8d8501329428ade48dd58dfa9b440a Mon Sep 17 00:00:00 2001 From: Danielle Lancashire Date: Fri, 14 Feb 2020 12:21:18 +0100 Subject: [PATCH] taskrunner/volume_hook: Cleanup arg order of prepareHostVolumes --- client/allocrunner/taskrunner/volume_hook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/allocrunner/taskrunner/volume_hook.go b/client/allocrunner/taskrunner/volume_hook.go index d6a8ffbc5..5e35f99d3 100644 --- a/client/allocrunner/taskrunner/volume_hook.go +++ b/client/allocrunner/taskrunner/volume_hook.go @@ -103,7 +103,7 @@ func partitionVolumesByType(xs map[string]*structs.VolumeRequest) map[string]map return result } -func (h *volumeHook) prepareHostVolumes(volumes map[string]*structs.VolumeRequest, req *interfaces.TaskPrestartRequest) ([]*drivers.MountConfig, error) { +func (h *volumeHook) prepareHostVolumes(req *interfaces.TaskPrestartRequest, volumes map[string]*structs.VolumeRequest) ([]*drivers.MountConfig, error) { hostVolumes := h.runner.clientConfig.Node.HostVolumes // Always validate volumes to ensure that we do not allow volumes to be used @@ -171,7 +171,7 @@ func (h *volumeHook) prepareCSIVolumes(req *interfaces.TaskPrestartRequest, volu func (h *volumeHook) Prestart(ctx context.Context, req *interfaces.TaskPrestartRequest, resp *interfaces.TaskPrestartResponse) error { volumes := partitionVolumesByType(h.alloc.Job.LookupTaskGroup(h.alloc.TaskGroup).Volumes) - hostVolumeMounts, err := h.prepareHostVolumes(volumes[structs.VolumeTypeHost], req) + hostVolumeMounts, err := h.prepareHostVolumes(req, volumes[structs.VolumeTypeHost]) if err != nil { return err }