Skip to content

Commit

Permalink
Move fault point to the iscsi mount function
Browse files Browse the repository at this point in the history
  • Loading branch information
kjaxdev authored Nov 8, 2024
1 parent 255e1fe commit 4c9d3f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/mount/mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 4c9d3f8

Please sign in to comment.