driver

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Overview

Package driver is a generated GoMock package.

Index

Constants

View Source
const (
	// VolumeTypeKey represents key for volume type
	VolumeTypeKey = "type"

	// IopsPerGBKey represents key for IOPS per GB
	IopsPerGBKey = "iopspergb"

	// AllowAutoIOPSPerGBIncreaseKey represents key for allowing automatic increase of IOPS
	AllowAutoIOPSPerGBIncreaseKey = "allowautoiopspergbincrease"

	// Iops represents key for IOPS for volume
	IopsKey = "iops"

	// ThroughputKey represents key for throughput
	ThroughputKey = "throughput"

	// EncryptedKey represents key for whether filesystem is encrypted
	EncryptedKey = "encrypted"

	// KmsKeyId represents key for KMS encryption key
	KmsKeyIDKey = "kmskeyid"

	// PVCNameKey contains name of the PVC for which is a volume provisioned.
	PVCNameKey = "csi.storage.k8s.io/pvc/name"

	// PVCNamespaceKey contains namespace of the PVC for which is a volume provisioned.
	PVCNamespaceKey = "csi.storage.k8s.io/pvc/namespace"

	// PVNameKey contains name of the final PV that will be used for the dynamically
	// provisioned volume
	PVNameKey = "csi.storage.k8s.io/pv/name"

	// TagKeyPrefix contains the prefix of a volume parameter that designates it as
	// a tag to be attached to the resource
	TagKeyPrefix = "tagSpecification"
)

constants of keys in volume parameters

View Source
const (
	// ResourceLifecycleTagPrefix is prefix of tag for provisioned EBS volume that
	// marks them as owned by the cluster. Used only when --cluster-id is set.
	ResourceLifecycleTagPrefix = "kubernetes.io/cluster/"

	// ResourceLifecycleOwned is the value we use when tagging resources to indicate
	// that the resource is considered owned and managed by the cluster,
	// and in particular that the lifecycle is tied to the lifecycle of the cluster.
	// From k8s.io/legacy-cloud-providers/aws/tags.go.
	ResourceLifecycleOwned = "owned"

	// NameTag is tag applied to provisioned EBS volume for backward compatibility with
	// in-tree volume plugin. Used only when --cluster-id is set.
	NameTag = "Name"

	// KubernetesClusterTag is tag applied to provisioned EBS volume for backward compatibility with
	// in-tree volume plugin. Used only when --cluster-id is set.
	// See https://github.com/kubernetes/cloud-provider-aws/blob/release-1.20/pkg/providers/v1/tags.go#L38-L41.
	KubernetesClusterTag = "KubernetesCluster"

	// PVCNameTag is tag applied to provisioned EBS volume for backward compatibility
	// with in-tree volume plugin. Value of the tag is PVC name. It is applied only when
	// the external provisioner sidecar is started with --extra-create-metadata=true and
	// thus provides such metadata to the CSI driver.
	PVCNameTag = "kubernetes.io/created-for/pvc/name"

	// PVCNamespaceTag is tag applied to provisioned EBS volume for backward compatibility
	// with in-tree volume plugin. Value of the tag is PVC namespace. It is applied only when
	// the external provisioner sidecar is started with --extra-create-metadata=true and
	// thus provides such metadata to the CSI driver.
	PVCNamespaceTag = "kubernetes.io/created-for/pvc/namespace"

	// PVNameTag is tag applied to provisioned EBS volume for backward compatibility
	// with in-tree volume plugin. Value of the tag is PV name. It is applied only when
	// the external provisioner sidecar is started with --extra-create-metadata=true and
	// thus provides such metadata to the CSI driver.
	PVNameTag = "kubernetes.io/created-for/pv/name"
)

constants for volume tags and their values

View Source
const (
	DriverName      = "ebs.csi.aws.com"
	AwsPartitionKey = "topology." + DriverName + "/partition"
	AwsAccountIDKey = "topology." + DriverName + "/account-id"
	AwsRegionKey    = "topology." + DriverName + "/region"
	AwsOutpostIDKey = "topology." + DriverName + "/outpost-id"

	WellKnownTopologyKey = "topology.kubernetes.io/zone"
	// DEPRECATED Use the WellKnownTopologyKey instead
	TopologyKey = "topology." + DriverName + "/zone"
)
View Source
const (
	// FSTypeExt2 represents the ext2 filesystem type
	FSTypeExt2 = "ext2"
	// FSTypeExt3 represents the ext3 filesystem type
	FSTypeExt3 = "ext3"
	// FSTypeExt4 represents the ext4 filesystem type
	FSTypeExt4 = "ext4"
	// FSTypeXfs represents the xfs filesystem type
	FSTypeXfs = "xfs"
	// FSTypeNtfs represents the ntfs filesystem type
	FSTypeNtfs = "ntfs"

	// VolumeOperationAlreadyExists is message fmt returned to CO when there is another in-flight call on the given volumeID
	VolumeOperationAlreadyExists = "An operation with the given volume=%q is already in progress"
)
View Source
const (
	//DefaultBlockSize represents the default block size (4KB)
	DefaultBlockSize = 4096
)

constants for disk block size

View Source
const (
	DefaultCSIEndpoint = "unix://tmp/csi.sock"
)

constants for default command line flag values

View Source
const (
	// devicePathKey represents key for device path in PublishContext
	// devicePath is the device path where the volume is attached to
	DevicePathKey = "devicePath"
)

constants of keys in PublishContext

View Source
const (
	// VolumeAttributePartition represents key for partition config in VolumeContext
	// this represents the partition number on a device used to mount
	VolumeAttributePartition = "partition"
)

constants of keys in VolumeContext

Variables

View Source
var (
	// NewMetadataFunc is a variable for the cloud.NewMetadata function that can
	// be overwritten in unit tests.
	NewMetadataFunc = cloud.NewMetadataService
	// NewCloudFunc is a variable for the cloud.NewCloud function that can
	// be overwritten in unit tests.
	NewCloudFunc = cloud.NewCloud
)
View Source
var (
	ValidFSTypes = map[string]struct{}{
		FSTypeExt2: {},
		FSTypeExt3: {},
		FSTypeExt4: {},
		FSTypeXfs:  {},
		FSTypeNtfs: {},
	}
)

Functions

func BuildOutpostArn added in v0.7.0

func BuildOutpostArn(segments map[string]string) string

BuildOutpostArn returns the string representation of the outpost ARN from the given csi.TopologyRequirement.segments

func GetVersionJSON added in v0.2.0

func GetVersionJSON() (string, error)

func ValidateDriverOptions added in v0.5.0

func ValidateDriverOptions(options *DriverOptions) error

func WithAwsSdkDebugLog added in v1.0.0

func WithAwsSdkDebugLog(enableSdkDebugLog bool) func(*DriverOptions)

func WithEndpoint added in v0.5.0

func WithEndpoint(endpoint string) func(*DriverOptions)

func WithExtraTags added in v0.8.0

func WithExtraTags(extraTags map[string]string) func(*DriverOptions)

func WithExtraVolumeTags added in v0.5.0

func WithExtraVolumeTags(extraVolumeTags map[string]string) func(*DriverOptions)

func WithKubernetesClusterID added in v0.6.0

func WithKubernetesClusterID(clusterID string) func(*DriverOptions)

func WithMode added in v0.5.0

func WithMode(mode Mode) func(*DriverOptions)

func WithVolumeAttachLimit added in v0.6.0

func WithVolumeAttachLimit(volumeAttachLimit int64) func(*DriverOptions)

func WithWarnOnInvalidTag added in v1.6.0

func WithWarnOnInvalidTag(warnOnInvalidTag bool) func(*DriverOptions)

Types

type DeviceIdentifier added in v1.4.0

type DeviceIdentifier interface {
	Lstat(name string) (os.FileInfo, error)
	EvalSymlinks(path string) (string, error)
}

DeviceIdentifier is for mocking os io functions used for the driver to identify an EBS volume's corresponding device (in Linux, the path under /dev; in Windows, the volume number) so that it can mount it. For volumes already mounted, see GetDeviceNameFromMount. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html#identify-nvme-ebs-device

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(options ...func(*DriverOptions)) (*Driver, error)

func (*Driver) ControllerExpandVolume added in v0.4.0

func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)

func (*Driver) ControllerGetCapabilities

func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)

func (*Driver) ControllerGetVolume added in v1.0.0

func (d *Driver) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)

func (*Driver) ControllerPublishVolume

func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)

func (*Driver) ControllerUnpublishVolume

func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)

func (*Driver) CreateSnapshot

func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)

func (*Driver) DeleteSnapshot

func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)

func (*Driver) GetCapacity

func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)

func (*Driver) GetPluginInfo

func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)

func (*Driver) IsBlockDevice added in v0.9.0

func (d *Driver) IsBlockDevice(fullPath string) (bool, error)

IsBlock checks if the given path is a block device

func (*Driver) ListSnapshots

func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)

func (*Driver) ListVolumes

func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)

func (*Driver) NodeExpandVolume added in v0.4.0

func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)

func (*Driver) NodeGetCapabilities

func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)

func (*Driver) NodeGetInfo

func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

func (*Driver) NodeGetVolumeStats added in v0.2.0

func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)

func (*Driver) NodePublishVolume

func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)

func (*Driver) NodeStageVolume

func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)

func (*Driver) NodeUnpublishVolume

func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)

func (*Driver) NodeUnstageVolume

func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)

func (*Driver) Probe

func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

func (*Driver) Run

func (d *Driver) Run() error

func (*Driver) Stop

func (d *Driver) Stop()

func (*Driver) ValidateVolumeCapabilities

func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)

type DriverOptions added in v0.5.0

type DriverOptions struct {
	// contains filtered or unexported fields
}

type MockDeviceIdentifier added in v1.4.0

type MockDeviceIdentifier struct {
	// contains filtered or unexported fields
}

MockDeviceIdentifier is a mock of DeviceIdentifier interface.

func NewMockDeviceIdentifier added in v1.4.0

func NewMockDeviceIdentifier(ctrl *gomock.Controller) *MockDeviceIdentifier

NewMockDeviceIdentifier creates a new mock instance.

func (*MockDeviceIdentifier) EXPECT added in v1.4.0

EXPECT returns an object that allows the caller to indicate expected use.

func (m *MockDeviceIdentifier) EvalSymlinks(path string) (string, error)

EvalSymlinks mocks base method.

func (*MockDeviceIdentifier) Lstat added in v1.4.0

func (m *MockDeviceIdentifier) Lstat(name string) (os.FileInfo, error)

Lstat mocks base method.

type MockDeviceIdentifierMockRecorder added in v1.4.0

type MockDeviceIdentifierMockRecorder struct {
	// contains filtered or unexported fields
}

MockDeviceIdentifierMockRecorder is the mock recorder for MockDeviceIdentifier.

func (mr *MockDeviceIdentifierMockRecorder) EvalSymlinks(path interface{}) *gomock.Call

EvalSymlinks indicates an expected call of EvalSymlinks.

func (*MockDeviceIdentifierMockRecorder) Lstat added in v1.4.0

func (mr *MockDeviceIdentifierMockRecorder) Lstat(name interface{}) *gomock.Call

Lstat indicates an expected call of Lstat.

type MockMounter added in v1.4.0

type MockMounter struct {
	// contains filtered or unexported fields
}

MockMounter is a mock of Mounter interface.

func NewMockMounter added in v1.4.0

func NewMockMounter(ctrl *gomock.Controller) *MockMounter

NewMockMounter creates a new mock instance.

func (*MockMounter) EXPECT added in v1.4.0

func (m *MockMounter) EXPECT() *MockMounterMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMounter) FormatAndMount added in v1.4.0

func (m *MockMounter) FormatAndMount(source, target, fstype string, options []string) error

FormatAndMount mocks base method.

func (*MockMounter) GetDeviceNameFromMount added in v1.4.0

func (m *MockMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)

GetDeviceNameFromMount mocks base method.

func (*MockMounter) GetMountRefs added in v1.4.0

func (m *MockMounter) GetMountRefs(pathname string) ([]string, error)

GetMountRefs mocks base method.

func (*MockMounter) IsCorruptedMnt added in v1.4.0

func (m *MockMounter) IsCorruptedMnt(err error) bool

IsCorruptedMnt mocks base method.

func (*MockMounter) IsLikelyNotMountPoint added in v1.4.0

func (m *MockMounter) IsLikelyNotMountPoint(file string) (bool, error)

IsLikelyNotMountPoint mocks base method.

func (*MockMounter) List added in v1.4.0

func (m *MockMounter) List() ([]mount_utils.MountPoint, error)

List mocks base method.

func (*MockMounter) MakeDir added in v1.4.0

func (m *MockMounter) MakeDir(path string) error

MakeDir mocks base method.

func (*MockMounter) MakeFile added in v1.4.0

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

MakeFile mocks base method.

func (*MockMounter) Mount added in v1.4.0

func (m *MockMounter) Mount(source, target, fstype string, options []string) error

Mount mocks base method.

func (*MockMounter) MountSensitive added in v1.4.0

func (m *MockMounter) MountSensitive(source, target, fstype string, options, sensitiveOptions []string) error

MountSensitive mocks base method.

func (*MockMounter) MountSensitiveWithoutSystemd added in v1.4.0

func (m *MockMounter) MountSensitiveWithoutSystemd(source, target, fstype string, options, sensitiveOptions []string) error

MountSensitiveWithoutSystemd mocks base method.

func (*MockMounter) MountSensitiveWithoutSystemdWithMountFlags added in v1.5.3

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

MountSensitiveWithoutSystemdWithMountFlags mocks base method.

func (*MockMounter) NeedResize added in v1.4.0

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

NeedResize mocks base method.

func (*MockMounter) NewResizeFs added in v1.6.0

func (m *MockMounter) NewResizeFs() (Resizefs, error)

NewResizeFs mocks base method.

func (*MockMounter) PathExists added in v1.4.0

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

PathExists mocks base method.

func (*MockMounter) Unmount added in v1.4.0

func (m *MockMounter) Unmount(target string) error

Unmount mocks base method.

func (*MockMounter) Unpublish added in v1.6.0

func (m *MockMounter) Unpublish(path string) error

Unpublish mocks base method.

func (*MockMounter) Unstage added in v1.6.0

func (m *MockMounter) Unstage(path string) error

Unstage mocks base method.

type MockMounterMockRecorder added in v1.4.0

type MockMounterMockRecorder struct {
	// contains filtered or unexported fields
}

MockMounterMockRecorder is the mock recorder for MockMounter.

func (*MockMounterMockRecorder) FormatAndMount added in v1.4.0

func (mr *MockMounterMockRecorder) FormatAndMount(source, target, fstype, options interface{}) *gomock.Call

FormatAndMount indicates an expected call of FormatAndMount.

func (*MockMounterMockRecorder) GetDeviceNameFromMount added in v1.4.0

func (mr *MockMounterMockRecorder) GetDeviceNameFromMount(mountPath interface{}) *gomock.Call

GetDeviceNameFromMount indicates an expected call of GetDeviceNameFromMount.

func (*MockMounterMockRecorder) GetMountRefs added in v1.4.0

func (mr *MockMounterMockRecorder) GetMountRefs(pathname interface{}) *gomock.Call

GetMountRefs indicates an expected call of GetMountRefs.

func (*MockMounterMockRecorder) IsCorruptedMnt added in v1.4.0

func (mr *MockMounterMockRecorder) IsCorruptedMnt(err interface{}) *gomock.Call

IsCorruptedMnt indicates an expected call of IsCorruptedMnt.

func (*MockMounterMockRecorder) IsLikelyNotMountPoint added in v1.4.0

func (mr *MockMounterMockRecorder) IsLikelyNotMountPoint(file interface{}) *gomock.Call

IsLikelyNotMountPoint indicates an expected call of IsLikelyNotMountPoint.

func (*MockMounterMockRecorder) List added in v1.4.0

func (mr *MockMounterMockRecorder) List() *gomock.Call

List indicates an expected call of List.

func (*MockMounterMockRecorder) MakeDir added in v1.4.0

func (mr *MockMounterMockRecorder) MakeDir(path interface{}) *gomock.Call

MakeDir indicates an expected call of MakeDir.

func (*MockMounterMockRecorder) MakeFile added in v1.4.0

func (mr *MockMounterMockRecorder) MakeFile(path interface{}) *gomock.Call

MakeFile indicates an expected call of MakeFile.

func (*MockMounterMockRecorder) Mount added in v1.4.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.4.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.4.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.5.3

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.4.0

func (mr *MockMounterMockRecorder) NeedResize(devicePath, deviceMountPath interface{}) *gomock.Call

NeedResize indicates an expected call of NeedResize.

func (*MockMounterMockRecorder) NewResizeFs added in v1.6.0

func (mr *MockMounterMockRecorder) NewResizeFs() *gomock.Call

NewResizeFs indicates an expected call of NewResizeFs.

func (*MockMounterMockRecorder) PathExists added in v1.4.0

func (mr *MockMounterMockRecorder) PathExists(path interface{}) *gomock.Call

PathExists indicates an expected call of PathExists.

func (*MockMounterMockRecorder) Unmount added in v1.4.0

func (mr *MockMounterMockRecorder) Unmount(target interface{}) *gomock.Call

Unmount indicates an expected call of Unmount.

func (*MockMounterMockRecorder) Unpublish added in v1.6.0

func (mr *MockMounterMockRecorder) Unpublish(path interface{}) *gomock.Call

Unpublish indicates an expected call of Unpublish.

func (*MockMounterMockRecorder) Unstage added in v1.6.0

func (mr *MockMounterMockRecorder) Unstage(path interface{}) *gomock.Call

Unstage indicates an expected call of Unstage.

type MockResizefs added in v1.6.0

type MockResizefs struct {
	// contains filtered or unexported fields
}

MockResizefs is a mock of Resizefs interface.

func NewMockResizefs added in v1.6.0

func NewMockResizefs(ctrl *gomock.Controller) *MockResizefs

NewMockResizefs creates a new mock instance.

func (*MockResizefs) EXPECT added in v1.6.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockResizefs) Resize added in v1.6.0

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

Resize mocks base method.

type MockResizefsMockRecorder added in v1.6.0

type MockResizefsMockRecorder struct {
	// contains filtered or unexported fields
}

MockResizefsMockRecorder is the mock recorder for MockResizefs.

func (*MockResizefsMockRecorder) Resize added in v1.6.0

func (mr *MockResizefsMockRecorder) Resize(devicePath, deviceMountPath interface{}) *gomock.Call

Resize indicates an expected call of Resize.

type Mode added in v0.5.0

type Mode string

Mode is the operating mode of the CSI driver.

const (
	// ControllerMode is the mode that only starts the controller service.
	ControllerMode Mode = "controller"
	// NodeMode is the mode that only starts the node service.
	NodeMode Mode = "node"
	// AllMode is the mode that only starts both the controller and the node service.
	AllMode Mode = "all"
)

type Mounter added in v0.4.0

type Mounter interface {
	mountutils.Interface

	FormatAndMount(source string, target string, fstype string, options []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
	NewResizeFs() (Resizefs, 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

type NodeMounter added in v0.4.0

type NodeMounter struct {
	*mountutils.SafeFormatAndMount
}

NodeMounter implements Mounter. A superstruct of SafeFormatAndMount.

func (NodeMounter) GetDeviceNameFromMount added in v0.10.0

func (m NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)

GetDeviceNameFromMount returns the volume ID for a mount path.

func (NodeMounter) IsCorruptedMnt added in v1.1.4

func (m NodeMounter) IsCorruptedMnt(err error) bool

IsCorruptedMnt return true if err is about corrupted mount point

func (*NodeMounter) MakeDir added in v0.5.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 v0.5.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.0.0

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

func (*NodeMounter) NewResizeFs added in v1.6.0

func (m *NodeMounter) NewResizeFs() (Resizefs, error)

func (*NodeMounter) PathExists added in v0.10.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) Unpublish added in v1.6.0

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

func (*NodeMounter) Unstage added in v1.6.0

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

type Resizefs added in v1.6.0

type Resizefs interface {
	Resize(devicePath, deviceMountPath string) (bool, error)
}

type VersionInfo added in v0.2.0

type VersionInfo struct {
	DriverVersion string `json:"driverVersion"`
	GitCommit     string `json:"gitCommit"`
	BuildDate     string `json:"buildDate"`
	GoVersion     string `json:"goVersion"`
	Compiler      string `json:"compiler"`
	Platform      string `json:"platform"`
}

func GetVersion added in v0.2.0

func GetVersion() VersionInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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