Documentation ¶
Overview ¶
Package mounter is a generated GoMock package.
Package mounter implements OS-specific functionality for interacting with mounts.
The package should any implementation of mount related functionality that is not portable across platforms.
Index ¶
- func NewSafeMounter() (*mountutils.SafeFormatAndMount, error)
- func NewSafeMounterV2() (*mountutils.SafeFormatAndMount, error)
- type MockMounter
- func (m *MockMounter) CanSafelySkipMountPointCheck() bool
- func (m *MockMounter) EXPECT() *MockMounterMockRecorder
- func (m *MockMounter) FindDevicePath(devicePath, volumeID, partition, region string) (string, error)
- func (m *MockMounter) FormatAndMountSensitiveWithFormatOptions(source, target, fstype string, ...) error
- func (m *MockMounter) GetBlockSizeBytes(devicePath string) (int64, error)
- func (m *MockMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)
- func (m *MockMounter) GetMountRefs(pathname string) ([]string, error)
- func (m *MockMounter) IsBlockDevice(fullPath string) (bool, error)
- func (m *MockMounter) IsCorruptedMnt(err error) bool
- func (m *MockMounter) IsLikelyNotMountPoint(file string) (bool, error)
- func (m *MockMounter) IsMountPoint(file string) (bool, error)
- func (m *MockMounter) List() ([]mount.MountPoint, error)
- func (m *MockMounter) MakeDir(path string) error
- func (m *MockMounter) MakeFile(path string) error
- func (m *MockMounter) Mount(source, target, fstype string, options []string) error
- func (m *MockMounter) MountSensitive(source, target, fstype string, options, sensitiveOptions []string) error
- func (m *MockMounter) MountSensitiveWithoutSystemd(source, target, fstype string, options, sensitiveOptions []string) error
- func (m *MockMounter) MountSensitiveWithoutSystemdWithMountFlags(source, target, fstype string, options, sensitiveOptions, mountFlags []string) error
- func (m *MockMounter) NeedResize(devicePath, deviceMountPath string) (bool, error)
- func (m *MockMounter) PathExists(path string) (bool, error)
- func (m *MockMounter) PreparePublishTarget(target string) error
- func (m *MockMounter) Resize(devicePath, deviceMountPath string) (bool, error)
- func (m *MockMounter) Unmount(target string) error
- func (m *MockMounter) Unpublish(path string) error
- func (m *MockMounter) Unstage(path string) error
- type MockMounterMockRecorder
- func (mr *MockMounterMockRecorder) CanSafelySkipMountPointCheck() *gomock.Call
- func (mr *MockMounterMockRecorder) FindDevicePath(devicePath, volumeID, partition, region interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) FormatAndMountSensitiveWithFormatOptions(source, target, fstype, options, sensitiveOptions, formatOptions interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) GetBlockSizeBytes(devicePath interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) GetDeviceNameFromMount(mountPath interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) GetMountRefs(pathname interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) IsBlockDevice(fullPath interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) IsCorruptedMnt(err interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) IsLikelyNotMountPoint(file interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) IsMountPoint(file interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) List() *gomock.Call
- func (mr *MockMounterMockRecorder) MakeDir(path interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) MakeFile(path interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) Mount(source, target, fstype, options interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) MountSensitive(source, target, fstype, options, sensitiveOptions interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) MountSensitiveWithoutSystemd(source, target, fstype, options, sensitiveOptions interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) MountSensitiveWithoutSystemdWithMountFlags(source, target, fstype, options, sensitiveOptions, mountFlags interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) NeedResize(devicePath, deviceMountPath interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) PathExists(path interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) PreparePublishTarget(target interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) Resize(devicePath, deviceMountPath interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) Unmount(target interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) Unpublish(path interface{}) *gomock.Call
- func (mr *MockMounterMockRecorder) Unstage(path interface{}) *gomock.Call
- type Mounter
- type NodeMounter
- func (m *NodeMounter) FindDevicePath(devicePath, volumeID, partition, region string) (string, error)
- func (m *NodeMounter) GetBlockSizeBytes(devicePath string) (int64, error)
- func (m NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)
- func (m *NodeMounter) IsBlockDevice(fullPath string) (bool, error)
- func (m NodeMounter) IsCorruptedMnt(err error) bool
- func (m *NodeMounter) MakeDir(path string) error
- func (m *NodeMounter) MakeFile(path string) error
- func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error)
- func (m *NodeMounter) PathExists(path string) (bool, error)
- func (m *NodeMounter) PreparePublishTarget(target string) error
- func (m *NodeMounter) Resize(devicePath, deviceMountPath string) (bool, error)
- func (m *NodeMounter) Unpublish(path string) error
- func (m *NodeMounter) Unstage(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSafeMounter ¶
func NewSafeMounter() (*mountutils.SafeFormatAndMount, error)
func NewSafeMounterV2 ¶ added in v1.31.0
func NewSafeMounterV2() (*mountutils.SafeFormatAndMount, error)
Types ¶
type MockMounter ¶ added in v1.30.0
type MockMounter struct {
// contains filtered or unexported fields
}
MockMounter is a mock of Mounter interface.
func NewMockMounter ¶ added in v1.30.0
func NewMockMounter(ctrl *gomock.Controller) *MockMounter
NewMockMounter creates a new mock instance.
func (*MockMounter) CanSafelySkipMountPointCheck ¶ added in v1.30.0
func (m *MockMounter) CanSafelySkipMountPointCheck() bool
CanSafelySkipMountPointCheck mocks base method.
func (*MockMounter) EXPECT ¶ added in v1.30.0
func (m *MockMounter) EXPECT() *MockMounterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMounter) FindDevicePath ¶ added in v1.30.0
func (m *MockMounter) FindDevicePath(devicePath, volumeID, partition, region string) (string, error)
FindDevicePath mocks base method.
func (*MockMounter) FormatAndMountSensitiveWithFormatOptions ¶ added in v1.30.0
func (m *MockMounter) FormatAndMountSensitiveWithFormatOptions(source, target, fstype string, options, sensitiveOptions, formatOptions []string) error
FormatAndMountSensitiveWithFormatOptions mocks base method.
func (*MockMounter) GetBlockSizeBytes ¶ added in v1.30.0
func (m *MockMounter) GetBlockSizeBytes(devicePath string) (int64, error)
GetBlockSizeBytes mocks base method.
func (*MockMounter) GetDeviceNameFromMount ¶ added in v1.30.0
func (m *MockMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)
GetDeviceNameFromMount mocks base method.
func (*MockMounter) GetMountRefs ¶ added in v1.30.0
func (m *MockMounter) GetMountRefs(pathname string) ([]string, error)
GetMountRefs mocks base method.
func (*MockMounter) IsBlockDevice ¶ added in v1.30.0
func (m *MockMounter) IsBlockDevice(fullPath string) (bool, error)
IsBlockDevice mocks base method.
func (*MockMounter) IsCorruptedMnt ¶ added in v1.30.0
func (m *MockMounter) IsCorruptedMnt(err error) bool
IsCorruptedMnt mocks base method.
func (*MockMounter) IsLikelyNotMountPoint ¶ added in v1.30.0
func (m *MockMounter) IsLikelyNotMountPoint(file string) (bool, error)
IsLikelyNotMountPoint mocks base method.
func (*MockMounter) IsMountPoint ¶ added in v1.30.0
func (m *MockMounter) IsMountPoint(file string) (bool, error)
IsMountPoint mocks base method.
func (*MockMounter) List ¶ added in v1.30.0
func (m *MockMounter) List() ([]mount.MountPoint, error)
List mocks base method.
func (*MockMounter) MakeDir ¶ added in v1.30.0
func (m *MockMounter) MakeDir(path string) error
MakeDir mocks base method.
func (*MockMounter) MakeFile ¶ added in v1.30.0
func (m *MockMounter) MakeFile(path string) error
MakeFile mocks base method.
func (*MockMounter) Mount ¶ added in v1.30.0
func (m *MockMounter) Mount(source, target, fstype string, options []string) error
Mount mocks base method.
func (*MockMounter) MountSensitive ¶ added in v1.30.0
func (m *MockMounter) MountSensitive(source, target, fstype string, options, sensitiveOptions []string) error
MountSensitive mocks base method.
func (*MockMounter) MountSensitiveWithoutSystemd ¶ added in v1.30.0
func (m *MockMounter) MountSensitiveWithoutSystemd(source, target, fstype string, options, sensitiveOptions []string) error
MountSensitiveWithoutSystemd mocks base method.
func (*MockMounter) MountSensitiveWithoutSystemdWithMountFlags ¶ added in v1.30.0
func (m *MockMounter) MountSensitiveWithoutSystemdWithMountFlags(source, target, fstype string, options, sensitiveOptions, mountFlags []string) error
MountSensitiveWithoutSystemdWithMountFlags mocks base method.
func (*MockMounter) NeedResize ¶ added in v1.30.0
func (m *MockMounter) NeedResize(devicePath, deviceMountPath string) (bool, error)
NeedResize mocks base method.
func (*MockMounter) PathExists ¶ added in v1.30.0
func (m *MockMounter) PathExists(path string) (bool, error)
PathExists mocks base method.
func (*MockMounter) PreparePublishTarget ¶ added in v1.30.0
func (m *MockMounter) PreparePublishTarget(target string) error
PreparePublishTarget mocks base method.
func (*MockMounter) Resize ¶ added in v1.30.0
func (m *MockMounter) Resize(devicePath, deviceMountPath string) (bool, error)
Resize mocks base method.
func (*MockMounter) Unmount ¶ added in v1.30.0
func (m *MockMounter) Unmount(target string) error
Unmount mocks base method.
func (*MockMounter) Unpublish ¶ added in v1.30.0
func (m *MockMounter) Unpublish(path string) error
Unpublish mocks base method.
func (*MockMounter) Unstage ¶ added in v1.30.0
func (m *MockMounter) Unstage(path string) error
Unstage mocks base method.
type MockMounterMockRecorder ¶ added in v1.30.0
type MockMounterMockRecorder struct {
// contains filtered or unexported fields
}
MockMounterMockRecorder is the mock recorder for MockMounter.
func (*MockMounterMockRecorder) CanSafelySkipMountPointCheck ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) CanSafelySkipMountPointCheck() *gomock.Call
CanSafelySkipMountPointCheck indicates an expected call of CanSafelySkipMountPointCheck.
func (*MockMounterMockRecorder) FindDevicePath ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) FindDevicePath(devicePath, volumeID, partition, region interface{}) *gomock.Call
FindDevicePath indicates an expected call of FindDevicePath.
func (*MockMounterMockRecorder) FormatAndMountSensitiveWithFormatOptions ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) FormatAndMountSensitiveWithFormatOptions(source, target, fstype, options, sensitiveOptions, formatOptions interface{}) *gomock.Call
FormatAndMountSensitiveWithFormatOptions indicates an expected call of FormatAndMountSensitiveWithFormatOptions.
func (*MockMounterMockRecorder) GetBlockSizeBytes ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) GetBlockSizeBytes(devicePath interface{}) *gomock.Call
GetBlockSizeBytes indicates an expected call of GetBlockSizeBytes.
func (*MockMounterMockRecorder) GetDeviceNameFromMount ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) GetDeviceNameFromMount(mountPath interface{}) *gomock.Call
GetDeviceNameFromMount indicates an expected call of GetDeviceNameFromMount.
func (*MockMounterMockRecorder) GetMountRefs ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) GetMountRefs(pathname interface{}) *gomock.Call
GetMountRefs indicates an expected call of GetMountRefs.
func (*MockMounterMockRecorder) IsBlockDevice ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) IsBlockDevice(fullPath interface{}) *gomock.Call
IsBlockDevice indicates an expected call of IsBlockDevice.
func (*MockMounterMockRecorder) IsCorruptedMnt ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) IsCorruptedMnt(err interface{}) *gomock.Call
IsCorruptedMnt indicates an expected call of IsCorruptedMnt.
func (*MockMounterMockRecorder) IsLikelyNotMountPoint ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) IsLikelyNotMountPoint(file interface{}) *gomock.Call
IsLikelyNotMountPoint indicates an expected call of IsLikelyNotMountPoint.
func (*MockMounterMockRecorder) IsMountPoint ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) IsMountPoint(file interface{}) *gomock.Call
IsMountPoint indicates an expected call of IsMountPoint.
func (*MockMounterMockRecorder) List ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) List() *gomock.Call
List indicates an expected call of List.
func (*MockMounterMockRecorder) MakeDir ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) MakeDir(path interface{}) *gomock.Call
MakeDir indicates an expected call of MakeDir.
func (*MockMounterMockRecorder) MakeFile ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) MakeFile(path interface{}) *gomock.Call
MakeFile indicates an expected call of MakeFile.
func (*MockMounterMockRecorder) Mount ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) Mount(source, target, fstype, options interface{}) *gomock.Call
Mount indicates an expected call of Mount.
func (*MockMounterMockRecorder) MountSensitive ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) MountSensitive(source, target, fstype, options, sensitiveOptions interface{}) *gomock.Call
MountSensitive indicates an expected call of MountSensitive.
func (*MockMounterMockRecorder) MountSensitiveWithoutSystemd ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) MountSensitiveWithoutSystemd(source, target, fstype, options, sensitiveOptions interface{}) *gomock.Call
MountSensitiveWithoutSystemd indicates an expected call of MountSensitiveWithoutSystemd.
func (*MockMounterMockRecorder) MountSensitiveWithoutSystemdWithMountFlags ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) MountSensitiveWithoutSystemdWithMountFlags(source, target, fstype, options, sensitiveOptions, mountFlags interface{}) *gomock.Call
MountSensitiveWithoutSystemdWithMountFlags indicates an expected call of MountSensitiveWithoutSystemdWithMountFlags.
func (*MockMounterMockRecorder) NeedResize ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) NeedResize(devicePath, deviceMountPath interface{}) *gomock.Call
NeedResize indicates an expected call of NeedResize.
func (*MockMounterMockRecorder) PathExists ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) PathExists(path interface{}) *gomock.Call
PathExists indicates an expected call of PathExists.
func (*MockMounterMockRecorder) PreparePublishTarget ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) PreparePublishTarget(target interface{}) *gomock.Call
PreparePublishTarget indicates an expected call of PreparePublishTarget.
func (*MockMounterMockRecorder) Resize ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) Resize(devicePath, deviceMountPath interface{}) *gomock.Call
Resize indicates an expected call of Resize.
func (*MockMounterMockRecorder) Unmount ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) Unmount(target interface{}) *gomock.Call
Unmount indicates an expected call of Unmount.
func (*MockMounterMockRecorder) Unpublish ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) Unpublish(path interface{}) *gomock.Call
Unpublish indicates an expected call of Unpublish.
func (*MockMounterMockRecorder) Unstage ¶ added in v1.30.0
func (mr *MockMounterMockRecorder) Unstage(path interface{}) *gomock.Call
Unstage indicates an expected call of Unstage.
type Mounter ¶ added in v1.30.0
type Mounter interface { mountutils.Interface FormatAndMountSensitiveWithFormatOptions(source string, target string, fstype string, options []string, sensitiveOptions []string, formatOptions []string) error IsCorruptedMnt(err error) bool GetDeviceNameFromMount(mountPath string) (string, int, error) MakeFile(path string) error MakeDir(path string) error PathExists(path string) (bool, error) NeedResize(devicePath string, deviceMountPath string) (bool, error) Unpublish(path string) error Unstage(path string) error Resize(devicePath, deviceMountPath string) (bool, error) FindDevicePath(devicePath, volumeID, partition, region string) (string, error) PreparePublishTarget(target string) error IsBlockDevice(fullPath string) (bool, error) GetBlockSizeBytes(devicePath string) (int64, error) }
Mounter is the interface implemented by NodeMounter. A mix & match of functions defined in upstream libraries. (FormatAndMount from struct SafeFormatAndMount, PathExists from an old edition of mount.Interface). Define it explicitly so that it can be mocked and to insulate from oft-changing upstream interfaces/structs
func NewNodeMounter ¶ added in v1.30.0
NewNodeMounter returns a new intsance of NodeMounter.
type NodeMounter ¶ added in v1.30.0
type NodeMounter struct {
*mountutils.SafeFormatAndMount
}
NodeMounter implements Mounter. A superstruct of SafeFormatAndMount.
func (*NodeMounter) FindDevicePath ¶ added in v1.30.0
func (m *NodeMounter) FindDevicePath(devicePath, volumeID, partition, region string) (string, error)
FindDevicePath finds path of device and verifies its existence if the device is not nvme, return the path directly if the device is nvme, finds and returns the nvme device path eg. /dev/nvme1n1
func (*NodeMounter) GetBlockSizeBytes ¶ added in v1.30.0
func (m *NodeMounter) GetBlockSizeBytes(devicePath string) (int64, error)
GetBlockSizeBytes gets the size of the disk in bytes
func (NodeMounter) GetDeviceNameFromMount ¶ added in v1.30.0
func (m NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)
GetDeviceNameFromMount returns the volume ID for a mount path.
func (*NodeMounter) IsBlockDevice ¶ added in v1.30.0
func (m *NodeMounter) IsBlockDevice(fullPath string) (bool, error)
IsBlockDevice checks if the given path is a block device
func (NodeMounter) IsCorruptedMnt ¶ added in v1.30.0
func (m NodeMounter) IsCorruptedMnt(err error) bool
IsCorruptedMnt return true if err is about corrupted mount point
func (*NodeMounter) MakeDir ¶ added in v1.30.0
func (m *NodeMounter) MakeDir(path string) error
This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code Please mirror the change to func MakeFile in ./sanity_test.go
func (*NodeMounter) MakeFile ¶ added in v1.30.0
func (m *NodeMounter) MakeFile(path string) error
This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code Please mirror the change to func MakeFile in ./sanity_test.go
func (*NodeMounter) NeedResize ¶ added in v1.30.0
func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error)
NeedResize checks if the filesystem of the given devicePath needs to be resized
func (*NodeMounter) PathExists ¶ added in v1.30.0
func (m *NodeMounter) PathExists(path string) (bool, error)
This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code Please mirror the change to func MakeFile in ./sanity_test.go
func (*NodeMounter) PreparePublishTarget ¶ added in v1.30.0
func (m *NodeMounter) PreparePublishTarget(target string) error
PreparePublishTarget creates the target directory for the volume to be mounted
func (*NodeMounter) Resize ¶ added in v1.30.0
func (m *NodeMounter) Resize(devicePath, deviceMountPath string) (bool, error)
Resize resizes the filesystem of the given devicePath
func (*NodeMounter) Unpublish ¶ added in v1.30.0
func (m *NodeMounter) Unpublish(path string) error
Unpublish unmounts the given path
func (*NodeMounter) Unstage ¶ added in v1.30.0
func (m *NodeMounter) Unstage(path string) error
Unstage unmounts the given path