From 4c9d3f8e572118fbf1746a89b78102484453fc3f Mon Sep 17 00:00:00 2001 From: keirj <72709769+kjaxdev@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:28:41 -0600 Subject: [PATCH] Move fault point to the iscsi mount function --- utils/mount/mount_linux.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/mount/mount_linux.go b/utils/mount/mount_linux.go index fb714a326..94934d4c2 100644 --- a/utils/mount/mount_linux.go +++ b/utils/mount/mount_linux.go @@ -237,10 +237,6 @@ func (client *LinuxClient) MountNFSPath(ctx context.Context, exportPath, mountpo Logc(ctx).WithField("error", err).Warning("Mkdir failed.") } - if err := beforeMount.Inject(); err != nil { - return err - } - if out, err := client.command.Execute(ctx, mountCommand, args...); err != nil { Logc(ctx).WithField("output", string(out)).Debug("Mount failed.") return fmt.Errorf("error mounting NFS volume %v on mountpoint %v: %v", exportPath, mountpoint, err) @@ -348,6 +344,10 @@ func (client *LinuxClient) MountDevice(ctx context.Context, device, mountpoint, client.createMountPoint(ctx, mountpoint, isMountPointFile) } + if err := beforeMount.Inject(); err != nil { + return err + } + if !mounted { if _, err := client.command.Execute(ctx, "mount", args...); err != nil { Logc(ctx).WithField("error", err).Error("Mount failed.")