fix(lint): remove ineffectual assignment in LVM snapshot mount
This commit is contained in:
@@ -136,12 +136,11 @@ func (l *LVMBackend) MountSnapshot(ctx context.Context, snap *Snapshot, mountPoi
|
|||||||
// Mount (read-only, nouuid for XFS)
|
// Mount (read-only, nouuid for XFS)
|
||||||
args := []string{"-o", "ro,nouuid", snapDevice, mountPoint}
|
args := []string{"-o", "ro,nouuid", snapDevice, mountPoint}
|
||||||
cmd := exec.CommandContext(ctx, "mount", args...)
|
cmd := exec.CommandContext(ctx, "mount", args...)
|
||||||
output, err := cmd.CombinedOutput()
|
if _, err := cmd.CombinedOutput(); err != nil {
|
||||||
if err != nil {
|
|
||||||
// Try without nouuid (for non-XFS)
|
// Try without nouuid (for non-XFS)
|
||||||
args = []string{"-o", "ro", snapDevice, mountPoint}
|
args = []string{"-o", "ro", snapDevice, mountPoint}
|
||||||
cmd = exec.CommandContext(ctx, "mount", args...)
|
cmd = exec.CommandContext(ctx, "mount", args...)
|
||||||
output, err = cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("mount failed: %s: %w", string(output), err)
|
return fmt.Errorf("mount failed: %s: %w", string(output), err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user