@@ -36,6 +36,7 @@ const (
36
36
37
37
type LinuxDeviceManager struct {
38
38
volumeMounter snapshot.VolumeMounter
39
+ cmdRunner * snapshot.LocalCommandRunner
39
40
opts map [string ]string
40
41
}
41
42
@@ -46,6 +47,7 @@ func NewLinuxDeviceManager(shell []string, opts map[string]string) (*LinuxDevice
46
47
47
48
return & LinuxDeviceManager {
48
49
volumeMounter : snapshot .NewVolumeMounter (shell ),
50
+ cmdRunner : & snapshot.LocalCommandRunner {Shell : shell },
49
51
opts : opts ,
50
52
}, nil
51
53
}
@@ -161,7 +163,7 @@ func (d *LinuxDeviceManager) hintFSTypes(partitions []*snapshot.PartitionInfo) (
161
163
}
162
164
163
165
func (d * LinuxDeviceManager ) attemptFindFstab (dir string ) ([]resources.FstabEntry , error ) {
164
- cmd , err := d .volumeMounter . CmdRunner () .RunCommand (fmt .Sprintf ("find %s -type f -wholename '*/etc/fstab'" , dir ))
166
+ cmd , err := d .cmdRunner .RunCommand (fmt .Sprintf ("find %s -type f -wholename '*/etc/fstab'" , dir ))
165
167
if err != nil {
166
168
log .Error ().Err (err ).Msg ("error searching for fstab" )
167
169
return nil , nil
@@ -479,7 +481,7 @@ func (c *LinuxDeviceManager) identifyViaDeviceName(deviceName string, mountAll b
479
481
return []* snapshot.PartitionInfo {}, nil
480
482
}
481
483
482
- blockDevices , err := c .volumeMounter . CmdRunner () .GetBlockDevices ()
484
+ blockDevices , err := c .cmdRunner .GetBlockDevices ()
483
485
if err != nil {
484
486
return nil , err
485
487
}
0 commit comments