mounter

package
v1.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedMounter = fmt.Errorf("unsupported mounter type")
)

Functions

func NewSafeMounter

func NewSafeMounter() (*mountutils.SafeFormatAndMount, error)

NewSafeMounter returns a new instance of SafeFormatAndMount.

func NewSafeMounterV2 added in v1.31.0

func NewSafeMounterV2() (*mountutils.SafeFormatAndMount, error)

NewSafeMounterV2 returns a new instance of SafeFormatAndMount.

Types

type CSIProxyMounter

type CSIProxyMounter struct {
	FsClient     *fsclient.Client
	DiskClient   *diskclient.Client
	VolumeClient *volumeclient.Client
}

func (*CSIProxyMounter) CanSafelySkipMountPointCheck added in v1.31.0

func (mounter *CSIProxyMounter) CanSafelySkipMountPointCheck() bool

func (*CSIProxyMounter) DeviceOpened

func (mounter *CSIProxyMounter) DeviceOpened(pathname string) (bool, error)
func (mounter *CSIProxyMounter) EvalHostSymlinks(pathname string) (string, error)

func (*CSIProxyMounter) ExistsPath

func (mounter *CSIProxyMounter) ExistsPath(path string) (bool, error)

ExistsPath - Checks if a path exists. Unlike util ExistsPath, this call does not perform follow link.

func (*CSIProxyMounter) FindDevicePath added in v1.31.0

func (mounter *CSIProxyMounter) FindDevicePath(devicePath, volumeID, _, _ string) (string, error)

func (*CSIProxyMounter) FindDiskByLun

func (mounter *CSIProxyMounter) FindDiskByLun(lun string) (diskNum string, err error)

FindDiskByLun - given a lun number, find out the corresponding disk

func (*CSIProxyMounter) FormatAndMountSensitiveWithFormatOptions added in v1.15.0

func (mounter *CSIProxyMounter) FormatAndMountSensitiveWithFormatOptions(source string, target string, fstype string, options []string, sensitiveOptions []string, formatOptions []string) error

FormatAndMount - accepts the source disk number, target path to mount, the fstype to format with and options to be used.

func (*CSIProxyMounter) GetDeviceNameFromMount

func (mounter *CSIProxyMounter) GetDeviceNameFromMount(mountPath, _ string) (string, error)

GetDeviceNameFromMount returns the disk number for a mount path.

func (*CSIProxyMounter) GetDeviceSize added in v1.6.0

func (mounter *CSIProxyMounter) GetDeviceSize(devicePath string) (int64, error)

GetDeviceSize returns the size of the disk in bytes

func (*CSIProxyMounter) GetFSGroup

func (mounter *CSIProxyMounter) GetFSGroup(pathname string) (int64, error)

func (*CSIProxyMounter) GetMode

func (mounter *CSIProxyMounter) GetMode(pathname string) (os.FileMode, error)

func (*CSIProxyMounter) GetMountRefs

func (mounter *CSIProxyMounter) GetMountRefs(pathname string) ([]string, error)

func (*CSIProxyMounter) GetSELinuxSupport

func (mounter *CSIProxyMounter) GetSELinuxSupport(pathname string) (bool, error)

func (*CSIProxyMounter) GetVolumeSizeInBytes

func (mounter *CSIProxyMounter) GetVolumeSizeInBytes(deviceMountPath string) (int64, error)

GetVolumeSizeInBytes returns the size of the volume in bytes

func (*CSIProxyMounter) IsLikelyNotMountPoint

func (mounter *CSIProxyMounter) IsLikelyNotMountPoint(path string) (bool, error)

IsLikelyMountPoint - If the directory does not exists, the function will return os.ErrNotExist error.

If the path exists, call to CSI proxy will check if its a link, if its a link then existence of target
path is checked.

func (*CSIProxyMounter) IsMountPoint added in v1.13.0

func (mounter *CSIProxyMounter) IsMountPoint(file string) (bool, error)

IsMountPoint: determines if a directory is a mountpoint.

func (*CSIProxyMounter) IsMountPointMatch

func (mounter *CSIProxyMounter) IsMountPointMatch(mp mountutils.MountPoint, dir string) bool

func (*CSIProxyMounter) List

func (mounter *CSIProxyMounter) List() ([]mountutils.MountPoint, error)

func (*CSIProxyMounter) MakeDir

func (mounter *CSIProxyMounter) MakeDir(pathname string) error

MakeDir - Creates a directory. The CSI proxy takes in context information. Currently the make dir is only used from the staging code path, hence we call it with Plugin context..

func (*CSIProxyMounter) MakeFile

func (mounter *CSIProxyMounter) MakeFile(pathname string) error

func (*CSIProxyMounter) MakeRShared

func (mounter *CSIProxyMounter) MakeRShared(path string) error

func (*CSIProxyMounter) Mount

func (mounter *CSIProxyMounter) Mount(source string, target string, fstype string, options []string) error

Mount just creates a soft link at target pointing to source.

func (*CSIProxyMounter) MountSensitive

func (mounter *CSIProxyMounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error

func (*CSIProxyMounter) MountSensitiveWithoutSystemd

func (mounter *CSIProxyMounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error

func (*CSIProxyMounter) MountSensitiveWithoutSystemdWithMountFlags added in v1.5.3

func (mounter *CSIProxyMounter) MountSensitiveWithoutSystemdWithMountFlags(source string, target string, fstype string, options []string, sensitiveOptions []string, mountFlags []string) error

func (*CSIProxyMounter) PathIsDevice

func (mounter *CSIProxyMounter) PathIsDevice(pathname string) (bool, error)

func (*CSIProxyMounter) Rescan

func (mounter *CSIProxyMounter) Rescan() error

Rescan would trigger an update storage cache via the CSI proxy.

func (*CSIProxyMounter) ResizeVolume

func (mounter *CSIProxyMounter) ResizeVolume(deviceMountPath string) (bool, error)

ResizeVolume resizes the volume at given mount path

func (*CSIProxyMounter) Rmdir

func (mounter *CSIProxyMounter) Rmdir(path string) error

Rmdir - delete the given directory

func (*CSIProxyMounter) Unmount

func (mounter *CSIProxyMounter) Unmount(target string) error

func (*CSIProxyMounter) WriteVolumeCache added in v1.6.0

func (mounter *CSIProxyMounter) WriteVolumeCache(target string)

type CSIProxyMounterV2 added in v1.31.0

type CSIProxyMounterV2 struct {
	FsClient     fsv2.Interface
	DiskClient   diskv2.Interface
	VolumeClient volumev2.Interface
}

func (*CSIProxyMounterV2) CanSafelySkipMountPointCheck added in v1.31.0

func (mounter *CSIProxyMounterV2) CanSafelySkipMountPointCheck() bool

func (*CSIProxyMounterV2) DeviceOpened added in v1.31.0

func (mounter *CSIProxyMounterV2) DeviceOpened(pathname string) (bool, error)
func (mounter *CSIProxyMounterV2) EvalHostSymlinks(pathname string) (string, error)

func (*CSIProxyMounterV2) ExistsPath added in v1.31.0

func (mounter *CSIProxyMounterV2) ExistsPath(path string) (bool, error)

ExistsPath - Checks if a path exists. Unlike util ExistsPath, this call does not perform follow link.

func (*CSIProxyMounterV2) FindDevicePath added in v1.31.0

func (mounter *CSIProxyMounterV2) FindDevicePath(devicePath, volumeID, _, _ string) (string, error)

func (*CSIProxyMounterV2) FindDiskByLun added in v1.31.0

func (mounter *CSIProxyMounterV2) FindDiskByLun(lun string) (diskNum string, err error)

FindDiskByLun - given a lun number, find out the corresponding disk

func (*CSIProxyMounterV2) FormatAndMountSensitiveWithFormatOptions added in v1.31.0

func (mounter *CSIProxyMounterV2) FormatAndMountSensitiveWithFormatOptions(source string, target string, fstype string, options []string, sensitiveOptions []string, formatOptions []string) error

FormatAndMount - accepts the source disk number, target path to mount, the fstype to format with and options to be used.

func (*CSIProxyMounterV2) GetDeviceNameFromMount added in v1.31.0

func (mounter *CSIProxyMounterV2) GetDeviceNameFromMount(mountPath, _ string) (string, error)

GetDeviceNameFromMount returns the disk number for a mount path.

func (*CSIProxyMounterV2) GetDeviceSize added in v1.31.0

func (mounter *CSIProxyMounterV2) GetDeviceSize(devicePath string) (int64, error)

GetDeviceSize returns the size of the disk in bytes

func (*CSIProxyMounterV2) GetFSGroup added in v1.31.0

func (mounter *CSIProxyMounterV2) GetFSGroup(pathname string) (int64, error)

func (*CSIProxyMounterV2) GetMode added in v1.31.0

func (mounter *CSIProxyMounterV2) GetMode(pathname string) (os.FileMode, error)

func (*CSIProxyMounterV2) GetMountRefs added in v1.31.0

func (mounter *CSIProxyMounterV2) GetMountRefs(pathname string) ([]string, error)

func (*CSIProxyMounterV2) GetSELinuxSupport added in v1.31.0

func (mounter *CSIProxyMounterV2) GetSELinuxSupport(pathname string) (bool, error)

func (*CSIProxyMounterV2) GetVolumeSizeInBytes added in v1.31.0

func (mounter *CSIProxyMounterV2) GetVolumeSizeInBytes(deviceMountPath string) (int64, error)

GetVolumeSizeInBytes returns the size of the volume in bytes

func (*CSIProxyMounterV2) IsLikelyNotMountPoint added in v1.31.0

func (mounter *CSIProxyMounterV2) IsLikelyNotMountPoint(path string) (bool, error)

IsLikelyMountPoint - If the directory does not exists, the function will return os.ErrNotExist error.

If the path exists, call to CSI proxy will check if its a link, if its a link then existence of target
path is checked.

func (*CSIProxyMounterV2) IsMountPoint added in v1.31.0

func (mounter *CSIProxyMounterV2) IsMountPoint(file string) (bool, error)

IsMountPoint: determines if a directory is a mountpoint.

func (*CSIProxyMounterV2) IsMountPointMatch added in v1.31.0

func (mounter *CSIProxyMounterV2) IsMountPointMatch(mp mountutils.MountPoint, dir string) bool

func (*CSIProxyMounterV2) List added in v1.31.0

func (mounter *CSIProxyMounterV2) List() ([]mountutils.MountPoint, error)

func (*CSIProxyMounterV2) MakeDir added in v1.31.0

func (mounter *CSIProxyMounterV2) MakeDir(pathname string) error

MakeDir - Creates a directory. The CSI proxy takes in context information. Currently the make dir is only used from the staging code path, hence we call it with Plugin context..

func (*CSIProxyMounterV2) MakeFile added in v1.31.0

func (mounter *CSIProxyMounterV2) MakeFile(pathname string) error

func (*CSIProxyMounterV2) MakeRShared added in v1.31.0

func (mounter *CSIProxyMounterV2) MakeRShared(path string) error

func (*CSIProxyMounterV2) Mount added in v1.31.0

func (mounter *CSIProxyMounterV2) Mount(source string, target string, fstype string, options []string) error

Mount just creates a soft link at target pointing to source.

func (*CSIProxyMounterV2) MountSensitive added in v1.31.0

func (mounter *CSIProxyMounterV2) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error

func (*CSIProxyMounterV2) MountSensitiveWithoutSystemd added in v1.31.0

func (mounter *CSIProxyMounterV2) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error

func (*CSIProxyMounterV2) MountSensitiveWithoutSystemdWithMountFlags added in v1.31.0

func (mounter *CSIProxyMounterV2) MountSensitiveWithoutSystemdWithMountFlags(source string, target string, fstype string, options []string, sensitiveOptions []string, mountFlags []string) error

func (*CSIProxyMounterV2) PathIsDevice added in v1.31.0

func (mounter *CSIProxyMounterV2) PathIsDevice(pathname string) (bool, error)

func (*CSIProxyMounterV2) Rescan added in v1.31.0

func (mounter *CSIProxyMounterV2) Rescan() error

Rescan would trigger an update storage cache via the CSI proxy.

func (*CSIProxyMounterV2) ResizeVolume added in v1.31.0

func (mounter *CSIProxyMounterV2) ResizeVolume(deviceMountPath string) (bool, error)

ResizeVolume resizes the volume at given mount path

func (*CSIProxyMounterV2) Rmdir added in v1.31.0

func (mounter *CSIProxyMounterV2) Rmdir(path string) error

Rmdir - delete the given directory

func (*CSIProxyMounterV2) Unmount added in v1.31.0

func (mounter *CSIProxyMounterV2) Unmount(target string) error

func (*CSIProxyMounterV2) WriteVolumeCache added in v1.31.0

func (mounter *CSIProxyMounterV2) WriteVolumeCache(target string)

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

func NewNodeMounter(hostprocess bool) (Mounter, error)

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, _, _ string) (string, error)

func (NodeMounter) FormatAndMountSensitiveWithFormatOptions added in v1.30.0

func (m NodeMounter) FormatAndMountSensitiveWithFormatOptions(source string, target string, fstype string, options []string, sensitiveOptions []string, formatOptions []string) error

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. The ref count returned is always 1 or 0 because csi-proxy doesn't provide a way to determine the actual ref count (as opposed to Linux where the mount table gets read). In practice this shouldn't matter, as in the NodeStage case the ref count is ignored and in the NodeUnstage case, the ref count being >1 is just a warning. Command to determine ref count would be something like: Get-Volume -UniqueId "\\?\Volume{7c3da0c1-0000-0000-0000-010000000000}\" | Get-Partition | Select AccessPaths

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

func (*NodeMounter) MakeFile added in v1.30.0

func (m *NodeMounter) MakeFile(path string) error

func (*NodeMounter) NeedResize added in v1.30.0

func (m *NodeMounter) NeedResize(devicePath, deviceMountPath string) (bool, error)

NeedResize called at NodeStage to ensure file system is the correct size

func (*NodeMounter) PathExists added in v1.30.0

func (m *NodeMounter) PathExists(path string) (bool, error)

func (NodeMounter) PreparePublishTarget added in v1.30.0

func (m NodeMounter) PreparePublishTarget(target string) error

func (*NodeMounter) Resize added in v1.30.0

func (m *NodeMounter) Resize(devicePath, deviceMountPath string) (bool, error)

func (*NodeMounter) Unpublish added in v1.30.0

func (m *NodeMounter) Unpublish(target string) error

Unmount volume from target path

func (*NodeMounter) Unstage added in v1.30.0

func (m *NodeMounter) Unstage(target string) error

Unmount volume from staging path usually this staging path is a global directory on the node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL